|
|
@ -17,12 +17,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
package cn.hippo4j.adapter.rabbitmq;
|
|
|
|
package cn.hippo4j.adapter.rabbitmq;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
|
|
|
|
|
import java.util.concurrent.ThreadPoolExecutor;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hippo4j.adapter.base.ThreadPoolAdapter;
|
|
|
|
import cn.hippo4j.adapter.base.ThreadPoolAdapter;
|
|
|
|
import cn.hippo4j.adapter.base.ThreadPoolAdapterParameter;
|
|
|
|
import cn.hippo4j.adapter.base.ThreadPoolAdapterParameter;
|
|
|
|
import cn.hippo4j.adapter.base.ThreadPoolAdapterState;
|
|
|
|
import cn.hippo4j.adapter.base.ThreadPoolAdapterState;
|
|
|
@ -31,11 +25,16 @@ import com.google.common.collect.Lists;
|
|
|
|
import com.google.common.collect.Maps;
|
|
|
|
import com.google.common.collect.Maps;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.amqp.rabbit.connection.AbstractConnectionFactory;
|
|
|
|
import org.springframework.amqp.rabbit.connection.AbstractConnectionFactory;
|
|
|
|
import org.springframework.boot.context.event.ApplicationStartedEvent;
|
|
|
|
import org.springframework.boot.context.event.ApplicationStartedEvent;
|
|
|
|
import org.springframework.context.ApplicationListener;
|
|
|
|
import org.springframework.context.ApplicationListener;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
|
|
|
|
|
import java.util.concurrent.ThreadPoolExecutor;
|
|
|
|
|
|
|
|
|
|
|
|
import static cn.hippo4j.common.constant.ChangeThreadPoolConstants.CHANGE_DELIMITER;
|
|
|
|
import static cn.hippo4j.common.constant.ChangeThreadPoolConstants.CHANGE_DELIMITER;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -106,8 +105,7 @@ public class RabbitMQThreadPoolAdapter implements ThreadPoolAdapter, Application
|
|
|
|
ThreadPoolExecutor threadPoolTaskExecutor = (ThreadPoolExecutor) executor;
|
|
|
|
ThreadPoolExecutor threadPoolTaskExecutor = (ThreadPoolExecutor) executor;
|
|
|
|
RABBITMQ_THREAD_POOL_TASK_EXECUTOR.put(beanName, threadPoolTaskExecutor);
|
|
|
|
RABBITMQ_THREAD_POOL_TASK_EXECUTOR.put(beanName, threadPoolTaskExecutor);
|
|
|
|
log.info("Rabbitmq executor name {}", beanName);
|
|
|
|
log.info("Rabbitmq executor name {}", beanName);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
log.warn("Custom thread pools only support ThreadPoolExecutor");
|
|
|
|
log.warn("Custom thread pools only support ThreadPoolExecutor");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|