You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.6 KiB
Java
59 lines
1.6 KiB
Java
/**
|
|
* @Class Name : AsyncRestConfig.java
|
|
* @Description : AsyncRest , 사용안함 추후 예정
|
|
* @Version 1.0
|
|
* @Since 2019. 06. 21
|
|
* @Author 박영수
|
|
* <pre>
|
|
* 수정일 수정자 수정내용
|
|
* ------- ------------- ----------------------
|
|
*
|
|
|
|
* </pre>
|
|
*/
|
|
package gtpa.fis.api.cm.service;
|
|
|
|
import javax.net.ssl.SSLException;
|
|
|
|
import org.apache.log4j.Logger;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.http.client.Netty4ClientHttpRequestFactory;
|
|
import org.springframework.web.client.AsyncRestTemplate;
|
|
|
|
import io.netty.channel.nio.NioEventLoopGroup;
|
|
import io.netty.handler.ssl.SslContextBuilder;
|
|
|
|
/**
|
|
* @Class Name : AsyncRestConfig.java
|
|
* @Description : AsyncRest , 사용안함 추후 예정
|
|
* @Since 2019. 06. 21
|
|
* @Author 박영수
|
|
* <pre>
|
|
* 수정일 수정자 수정내용
|
|
* ------- ------------- ----------------------
|
|
*
|
|
|
|
* </pre>
|
|
*/
|
|
|
|
@Configuration
|
|
public class AsyncRestConfig {
|
|
|
|
static Logger logger = Logger.getLogger(AsyncRestConfig.class.getName());
|
|
|
|
@Bean
|
|
public AsyncRestTemplate asyncRestTemplate(){
|
|
AsyncRestTemplate asyncRestTemplate = new AsyncRestTemplate();
|
|
Netty4ClientHttpRequestFactory netty = new Netty4ClientHttpRequestFactory(new NioEventLoopGroup(1));
|
|
// try {
|
|
// netty.setSslContext(SslContextBuilder.forClient().build());
|
|
// } catch (SSLException e) {
|
|
// // TODO Auto-generated catch block
|
|
// }
|
|
asyncRestTemplate.setAsyncRequestFactory(netty);
|
|
logger.info("setAsyncRequestFactory 실행?");
|
|
return asyncRestTemplate;
|
|
}
|
|
}
|