22.02.19 12:51 작성
·
447
0
본문에는 예외가 발생 시 Retry 애노테이션을 확인해서
request를 재시도 하는것으로 나와있는데
막상 실행 시켜보면 예외가 발생하지 않아도
Retry 프록시가 실행되는거 같아서요
먼가 잘못이해하고 있는걸까요??
실행결과 로그는 아래와 같습니다.
2022-02-19 12:49:47.587 INFO 18976 --- [ main] hello.aop.exam.ExamTest : Started ExamTest in 3.008 seconds (JVM running for 5.288)
2022-02-19 12:49:48.363 INFO 18976 --- [ main] hello.aop.exam.ExamTest : client request i = 0
2022-02-19 12:49:48.387 INFO 18976 --- [ main] hello.aop.exam.aop.TraceAspect : [trace] void hello.aop.exam.ExamService.request(String) args=[data0]
2022-02-19 12:49:48.416 INFO 18976 --- [ main] hello.aop.exam.aop.TraceAspect : [trace] String hello.aop.exam.ExamRepository.save(String) args=[data0]
2022-02-19 12:49:48.417 INFO 18976 --- [ main] hello.aop.exam.aop.RetryAspect : [retry] String hello.aop.exam.ExamRepository.save(String) retry=@hello.aop.exam.annotation.Retry(value=4)
2022-02-19 12:49:48.417 INFO 18976 --- [ main] hello.aop.exam.aop.RetryAspect : [retry] try count=1/4
2022-02-19 12:49:48.428 INFO 18976 --- [ main] hello.aop.exam.ExamTest : client request i = 1
2022-02-19 12:49:48.429 INFO 18976 --- [ main] hello.aop.exam.aop.TraceAspect : [trace] void hello.aop.exam.ExamService.request(String) args=[data1]
2022-02-19 12:49:48.429 INFO 18976 --- [ main] hello.aop.exam.aop.TraceAspect : [trace] String hello.aop.exam.ExamRepository.save(String) args=[data1]
2022-02-19 12:49:48.430 INFO 18976 --- [ main] hello.aop.exam.aop.RetryAspect : [retry] String hello.aop.exam.ExamRepository.save(String) retry=@hello.aop.exam.annotation.Retry(value=4)
2022-02-19 12:49:48.430 INFO 18976 --- [ main] hello.aop.exam.aop.RetryAspect : [retry] try count=1/4
2022-02-19 12:49:48.430 INFO 18976 --- [ main] hello.aop.exam.ExamTest : client request i = 2
2022-02-19 12:49:48.430 INFO 18976 --- [ main] hello.aop.exam.aop.TraceAspect : [trace] void hello.aop.exam.ExamService.request(String) args=[data2]
2022-02-19 12:49:48.430 INFO 18976 --- [ main] hello.aop.exam.aop.TraceAspect : [trace] String hello.aop.exam.ExamRepository.save(String) args=[data2]
2022-02-19 12:49:48.432 INFO 18976 --- [ main] hello.aop.exam.aop.RetryAspect : [retry] String hello.aop.exam.ExamRepository.save(String) retry=@hello.aop.exam.annotation.Retry(value=4)
2022-02-19 12:49:48.432 INFO 18976 --- [ main] hello.aop.exam.aop.RetryAspect : [retry] try count=1/4
2022-02-19 12:49:48.432 INFO 18976 --- [ main] hello.aop.exam.ExamTest : client request i = 3
2022-02-19 12:49:48.432 INFO 18976 --- [ main] hello.aop.exam.aop.TraceAspect : [trace] void hello.aop.exam.ExamService.request(String) args=[data3]
2022-02-19 12:49:48.432 INFO 18976 --- [ main] hello.aop.exam.aop.TraceAspect : [trace] String hello.aop.exam.ExamRepository.save(String) args=[data3]
2022-02-19 12:49:48.432 INFO 18976 --- [ main] hello.aop.exam.aop.RetryAspect : [retry] String hello.aop.exam.ExamRepository.save(String) retry=@hello.aop.exam.annotation.Retry(value=4)
2022-02-19 12:49:48.433 INFO 18976 --- [ main] hello.aop.exam.aop.RetryAspect : [retry] try count=1/4
2022-02-19 12:49:48.433 INFO 18976 --- [ main] hello.aop.exam.ExamTest : client request i = 4
2022-02-19 12:49:48.433 INFO 18976 --- [ main] hello.aop.exam.aop.TraceAspect : [trace] void hello.aop.exam.ExamService.request(String) args=[data4]
2022-02-19 12:49:48.433 INFO 18976 --- [ main] hello.aop.exam.aop.TraceAspect : [trace] String hello.aop.exam.ExamRepository.save(String) args=[data4]
2022-02-19 12:49:48.433 INFO 18976 --- [ main] hello.aop.exam.aop.RetryAspect : [retry] String hello.aop.exam.ExamRepository.save(String) retry=@hello.aop.exam.annotation.Retry(value=4)
2022-02-19 12:49:48.433 INFO 18976 --- [ main] hello.aop.exam.aop.RetryAspect : [retry] try count=1/4
2022-02-19 12:49:48.433 INFO 18976 --- [ main] hello.aop.exam.aop.RetryAspect : [retry] try count=2/4
2022. 03. 02. 17:32
감사합니다!