/**
* 异步执行,需要返回的Future<>类型
*
* @param name
* @return
*/
@Async
public Future<RxJavaDTO> getRxJavaDTO(String name) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
log.info("common service begin to process");
RxJavaDTO item = new RxJavaDTO();
item.setName(name);
String value = MDC.get(MdcConstans.MDC_REMOTE_IP);
if (!StringUtils.isEmpty(value)) {
log.info("remoteid id " + value);
} else {
log.info("remoteid id is empty");
}
value = MDC.get(MdcConstans.MDC_ClientRequest_ID);
if (!StringUtils.isEmpty(value)) {
log.info("client id " + value);
} else {
log.info("client id is empty");
}
log.info("common service end to process");
return new AsyncResult<>(item);
}
CommonService.java 文件源码
java
阅读 24
收藏 0
点赞 0
评论 0
项目:springboot-scala-withswagger
作者:
评论列表
文章目录