dtp-引入dtp代替hippop4j
This commit is contained in:
@@ -90,6 +90,24 @@
|
||||
<version>${rocketmq-spring-boot.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara.dynamictp</groupId>
|
||||
<artifactId>dynamic-tp-spring-boot-starter-nacos</artifactId>
|
||||
<version>${dynamic-tp.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara.dynamictp</groupId>
|
||||
<artifactId>dynamic-tp-spring-boot-starter-adapter-webserver</artifactId>
|
||||
<version>${dynamic-tp.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara.dynamictp</groupId>
|
||||
<artifactId>dynamic-tp-spring-boot-starter-adapter-rocketmq</artifactId>
|
||||
<version>${dynamic-tp.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
@@ -0,0 +1,28 @@
|
||||
package com.accompany.common.config;
|
||||
|
||||
import com.accompany.core.base.SpringContextHolder;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.AsyncConfigurer;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
@Slf4j
|
||||
@EnableAsync
|
||||
@Configuration
|
||||
public class ExecutorConfig implements AsyncConfigurer {
|
||||
|
||||
@Override
|
||||
public Executor getAsyncExecutor() {
|
||||
return SpringContextHolder.getBean("async-executor");
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
|
||||
return (ex,method,params)->log.error("@Async 执行异步方法{} 错误,参数{}", method, JSON.toJSONString(params), ex);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user