|
|
|
@ -30,8 +30,6 @@ public class CustomerDataJob {
|
|
|
|
|
//固定线程数
|
|
|
|
|
private static final int THREAD_NUMBERS = 80;
|
|
|
|
|
|
|
|
|
|
//创建线程池
|
|
|
|
|
ExecutorService executors = Executors.newFixedThreadPool(THREAD_NUMBERS);
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private PrivilageCpUserStoreDOMapper privilageCpUserStoreDOMapper;
|
|
|
|
@ -46,8 +44,10 @@ public class CustomerDataJob {
|
|
|
|
|
private CustomerService customerService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void handle(){
|
|
|
|
|
|
|
|
|
|
//创建线程池
|
|
|
|
|
ExecutorService executors = Executors.newFixedThreadPool(THREAD_NUMBERS);
|
|
|
|
|
// 创建缓冲池
|
|
|
|
|
Disruptor<DTOMessage> disruptor = new Disruptor<>(new DTOMessageFactory(), BUFFER_SIZE, executors,
|
|
|
|
|
ProducerType.SINGLE, new BlockingWaitStrategy());
|
|
|
|
@ -58,6 +58,7 @@ public class CustomerDataJob {
|
|
|
|
|
for (int i = 0; i < consumers.length; i++) {
|
|
|
|
|
consumers[i] = new DTOMessageGroup1Consumer();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
disruptor.handleEventsWithWorkerPool(consumers);
|
|
|
|
|
|
|
|
|
|
disruptor.start();
|
|
|
|
|