2025-05-15 10:55:29 +08:00
|
|
|
package com.ebike.feign.config;
|
|
|
|
|
|
2025-05-29 17:58:12 +08:00
|
|
|
import com.ebike.feign.component.FeignTokenInterceptor;
|
2025-05-15 10:55:29 +08:00
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
import org.springframework.scheduling.annotation.EnableAsync;
|
|
|
|
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
|
|
|
|
|
|
|
|
|
import java.util.concurrent.Executor;
|
|
|
|
|
|
|
|
|
|
@Configuration
|
|
|
|
|
@EnableAsync
|
|
|
|
|
public class ExampleFeignConfiguration {
|
|
|
|
|
@Bean
|
|
|
|
|
public Executor asyncExecutor() {
|
|
|
|
|
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
|
|
|
|
executor.setCorePoolSize(10);
|
|
|
|
|
executor.setMaxPoolSize(50);
|
|
|
|
|
executor.setQueueCapacity(100);
|
|
|
|
|
executor.initialize();
|
|
|
|
|
return executor;
|
|
|
|
|
}
|
2025-05-29 17:58:12 +08:00
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
public FeignTokenInterceptor feignTokenInterceptor() {
|
|
|
|
|
return new FeignTokenInterceptor();
|
|
|
|
|
}
|
2025-05-15 10:55:29 +08:00
|
|
|
}
|