commit
This commit is contained in:
@@ -64,7 +64,7 @@ public class CommonFeignConfig {
|
|||||||
// OkHttp 요청 생성
|
// OkHttp 요청 생성
|
||||||
okhttp3.Request.Builder okHttpRequestBuilder = new okhttp3.Request.Builder()
|
okhttp3.Request.Builder okHttpRequestBuilder = new okhttp3.Request.Builder()
|
||||||
.url(request.url())
|
.url(request.url())
|
||||||
.method(request.httpMethod().name(), getRequestBody(request)); // 요청 본문 설정
|
.method(request.httpMethod().name(), request.httpMethod() == Request.HttpMethod.GET ? null : getRequestBody(request)); // 요청 본문 설정
|
||||||
|
|
||||||
// Feign 요청의 헤더를 OkHttp 요청에 추가
|
// Feign 요청의 헤더를 OkHttp 요청에 추가
|
||||||
request.headers().forEach((key, values) -> {
|
request.headers().forEach((key, values) -> {
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ package com.spring.infra.quartz;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.springframework.aop.support.AopUtils;
|
import org.springframework.aop.support.AopUtils;
|
||||||
|
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||||
import org.springframework.cloud.context.scope.refresh.RefreshScopeRefreshedEvent;
|
import org.springframework.cloud.context.scope.refresh.RefreshScopeRefreshedEvent;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
import org.springframework.context.ApplicationListener;
|
import org.springframework.context.ApplicationListener;
|
||||||
import org.springframework.context.event.ContextRefreshedEvent;
|
|
||||||
import org.springframework.context.event.EventListener;
|
import org.springframework.context.event.EventListener;
|
||||||
import org.springframework.lang.NonNull;
|
import org.springframework.lang.NonNull;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -27,14 +27,14 @@ import lombok.RequiredArgsConstructor;
|
|||||||
* <li>각 작업에 대한 JobDetail 및 Trigger를 생성합니다.</li>
|
* <li>각 작업에 대한 JobDetail 및 Trigger를 생성합니다.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* <p>이 클래스는 {@link ApplicationListener}를 구현하여 {@link ContextRefreshedEvent}가 발생할 때 자동으로 실행됩니다.</p>
|
* <p>이 클래스는 {@link ApplicationListener}를 구현하여 {@link ApplicationReadyEvent}가 발생할 때 자동으로 실행됩니다.</p>
|
||||||
*
|
*
|
||||||
* @author mindol
|
* @author mindol
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class QuartzJobRegistrar implements ApplicationListener<ContextRefreshedEvent> {
|
public class QuartzJobRegistrar implements ApplicationListener<ApplicationReadyEvent> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 애플리케이션 컨텍스트 객체입니다.
|
* 애플리케이션 컨텍스트 객체입니다.
|
||||||
@@ -58,7 +58,7 @@ public class QuartzJobRegistrar implements ApplicationListener<ContextRefreshedE
|
|||||||
* @param event ContextRefreshedEvent 객체
|
* @param event ContextRefreshedEvent 객체
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onApplicationEvent(@NonNull ContextRefreshedEvent event) {
|
public void onApplicationEvent(@NonNull ApplicationReadyEvent event) {
|
||||||
refreshJobs();
|
refreshJobs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user