본문 바로가기
728x90
반응형

spring71

[Spring] EhCache를 Caffeine Cache로 변경하는 방법 (Caffeine Cache 적용 방법) 캐시 비교 게시글은 많기 때문에 생략하겠습니다. (Redis, EhCache, Caffeine 비교 , EhCache, Caffeine 비교) 해당 본문에서는 로컬 캐시가 EhCache로 설정되어 있는 환경을 Caffeine Cache로 변경하는 방법을 다루겠습니다. 1. pom.xml dependency를 변경합니다. ehcache caffeine net.sf.ehcache ehcache com.github.ben-manes.caffeine caffeine 3.1.1 2. application.yml ehcache 설정을 제거합니다. ehcache caffeine spring: cache: ehcache: config: classpath:cache/ehcache.xml 제거 3. Configuratio.. 2022. 6. 24.
[Spring] HttpStatus.LOCKED : 423 Client Error HTTP Status Code는 클라이언트가 보낸 HTTP 요청에 대한 서버의 응답을 코드로 표현한 것으로, 해당 코드로 요청의 성공, 실패, 실패 요인 등을 알 수 있습니다. HTTP 상태 코드 중 LOCKED 상태 코드에 대해 알아보겠습니다. Locked라는 단어만으로 단순히 잠금상태로 판단하고 계정 잠금 등에 사용하면 안 됩니다. 423 상태 코드는 메서드의 소스 또는 대상 리소스가 잠겨 있음을 의미합니다. 이 응답에는 'lock-token-submitted' 또는 'non-conflict-lock'과 같은 적절한 전제 조건 또는 사후 조건 코드가 포함되어야 합니다. 423 Locked The 423 (Locked) status code means the source or destination re.. 2022. 6. 3.
[Spring] AOP와 @EnableAspectJAutoProxy Spring AOP (Aspect Oriented Programming) AOP는 Aspect Oriented Programming의 약자로 관점 지향 프로그래밍이라고 불립니다. 쉽게 말해 관점에 따라 각각 모듈화(어떤 공통된 로직이나 기능을 하나의 단위로 묶음)하겠다는 것입니다. 소스 코드에서 여러 코드에서 반복해서 사용하는 코드를 발견할 수 있는데 이것을 흩어진 관심사(Crosscutting Concerns)라고 합니다. 흩어진 관심사를 Aspect로 모듈화하고 핵심적인 비지니스 로직에서 분리하여 재사용하겠다는 것이 AOP의 취지입니다. AOP 주요 개념 Aspect : 흩어진 관심사를 모듈화 한 것 Target : Aspect를 적용하는 곳 (ElementType 등) Advice : 실질적인 부가.. 2022. 4. 27.
[Spring Security] DelegatingPasswordEncoder와 BCryptPasswordEncoder strength에 따른 수행시간 DelegatingPasswordEncoder에 대해 정리하기 전에, 스프링 시큐리티 래퍼런스 내용을 살펴보겠습니다. Srping Password Storage Spring Security’s PasswordEncoder interface is used to perform a one way transformation of a password to allow the password to be stored securely. Given PasswordEncoder is a one way transformation, it is not intended when the password transformation needs to be two way (i.e. storing credentials used to auth.. 2022. 3. 20.
[Spring Batch4] batch step에서 processor chaining하는 방법 다음과 같은 batch step이 존재할 때, processor를 추가하기 위해선 어떻게 해야 할까요?@Beanpublic Job ioSampleJob() { return this.jobBuilderFactory.get("ioSampleJob") .start(step1()) .build();}@Beanpublic Step step1() { return this.stepBuilderFactory.get("step1") .chunk(2) .reader(fooReader()) .processor(fooProcessor()) .writer(barWriter()) .build();}public class Foo {}public class Bar { public Bar(F.. 2022. 2. 4.
[Spring] java.lang.ExceptionInInitializerError: com.sun.tools.javac.code.TypeTags Maven install 시, java.lang.ExceptionInInitializerError: com.sun.tools.javac.code.TypeTags 에러 발생. lombok 버전 업으로 문제 해결. org.projectlombok lombok 1.18.6 2021. 11. 30.
[Spring Batch] org.springframework.dao.EmptyResultDataAccessException: Item 0 of 500 did not update any rows Spring Batch 실행 시 아래와 같은 오류가 발생했습니다.org.springframework.dao.EmptyResultDataAccessException: Item 0 of 500 did not update any rows: [...] at org.mybatis.spring.batch.MyBatisBatchItemWriter.write(MyBatisBatchItemWriter.java:161) at org.springframework.batch.core.step.item.SimpleChunkProcessor.writeItems(SimpleChunkProcessor.java:193) at org.springframework.batch.core.step.item.SimpleChunk.. 2021. 11. 18.
[Maven Build Error] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project : Fatal error compiling 메이븐 빌드 시 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project : Fatal error compiling 와 같은 오류가 발생했다면 jdk 버전을 확인해보면됩니다. 2021. 11. 17.
[Spring] dynamic Scheduler 다이나믹 스케줄링 @ImportResource({ "classpath:scheduler/context-scheduler.xml" }) 나 @Scheduled 어노테이션을 사용하지 않고 스케줄을 동적으로 등록하는 두가지 방법을 알아보겠습니다.  1. ThreadPoolTaskScheduler꼭 아래 예시와 같이 사용할 필욘 없지만, Map에 scheduler를 저장해놓고 destroy 할 수 있습니다.@Servicepublic class SchedulerServiceImpl implements SchedulerService { private final Map schedulerMap = new ConcurrentHashMap(); public SchedulerServiceImpl() { Set typeList = ...; .. 2021. 11. 9.
[Spring Batch] step 중지/통과 하기 Step 실행 중일 때 다음 단계로 넘어가지 않고 중지하는 방법은 throw 하면 됩니다. public class PoisonPillItemProcessor implements ItemProcessor { @Override public T process(T item) throws Exception { if (isPoisonPill(item)) { throw new PoisonPillException("Poison pill detected: " + item); } return item; } } 이번 단계는 지나치고 다음 단계로 넘어가는 방법은 null을 리턴하면됩니다. public class PoisonPillItemProcessor implements ItemProcessor { @Override pub.. 2021. 10. 21.
728x90
반응형