Skip to content

Instantly share code, notes, and snippets.

Joseph Yoon cooljoseph

Block or report user

Report or block cooljoseph

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View emacs lisp
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
;; Base distribution to use. This is a layer contained in the directory
public @interface CircuitBreaker {
cooljoseph /
Last active Apr 20, 2016
Flask 첫 코드
# -*- coding:utf-8 -*-
## 한글 사용을 위함
from flask import Flask
app = Flask(__name__)
def index():
return "안녕하세요 Flask"
View batch.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""
<job id="test.job" parent="common.test.job" xmlns="">
<step id="test.job.step" parent="common.test.step">
package kr.sidnancy81.reader.test;
// apache lang 관련 패키지 import 문 생략
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.StepExecutionListener;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.NonTransientResourceException;
import org.springframework.batch.item.ParseException;
import org.springframework.batch.item.UnexpectedInputException;
cooljoseph / Result.txt
Created Feb 4, 2014
MultiRoutingDataSource Test 코드
View Result.txt
2012-03-14 17:27:24 DEBUG [PROFILE:57] – +–>[SERVICE_S] UserReviewService.getTotalCountOfUserReview()
2012-03-14 17:27:24 DEBUG [PROFILE:77] – DataSource ===> DIST_READ
View applicationContext.xml
<aop:aspectj-autoproxy proxy-target-class=”true” />
<!– @Service단에서 Transaction 처리도 함께 해주기 위해 transaction manager의 order는 2로 내려준다. –>
<tx:annotation-driven proxy-target-class=”true” order=”2″/>
cooljoseph /
Created Feb 4, 2014
AOP로 DataSource 판단을 한다.
import java.lang.reflect.Method;
import java.util.Calendar;
import java.util.Collection;
import java.util.Iterator;
import kr.sidnancy.annotation.DataSource;
import kr.sidnancy.common.inf.datasource.ContextHolder;
import kr.sidnancy.common.type.DataSourceType;
import org.aspectj.lang.ProceedingJoinPoint;
cooljoseph / applicationContext.xml
Created Feb 4, 2014
DataSource가 RoutingDataSource에서 판단되는 값에 따라 설정될 수 있도록 아래와 같이 Context 설정을 해준다.
View applicationContext.xml
<bean id=”dataSource” class=”kr.sidnancy.common.inf.datasource.RoutingDataSource”>
<property name=”targetDataSources”>
<map key-type=”kr.sidnancy.common.type.DataSourceType”>
<entry key=”MASTER” value-ref=”primaryDataSource” />
<entry key=”SLAVE” value-ref=”standbyDataSource” />
<entry key=”DIST_READ” value-ref=”distReadDataSource”/>
<entry key=”DIST_WRITE” value-ref=”distWriteDataSource”/>
<!– Default DataSource –>
cooljoseph /
Last active Aug 29, 2015
enum 으로 DataSource 별 Type을 셋팅한다.
package kr.sidnancy.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
public @interface DataSource {
You can’t perform that action at this time.