|
@@ -7,8 +7,10 @@ import com.google.gson.Gson;
|
|
|
import com.rabbitmq.client.Channel;
|
|
|
import org.springframework.amqp.core.AcknowledgeMode;
|
|
|
import org.springframework.amqp.core.Message;
|
|
|
-import org.springframework.amqp.rabbit.core.ChannelAwareMessageListener;
|
|
|
+import org.springframework.amqp.core.Queue;
|
|
|
+import org.springframework.amqp.rabbit.connection.ConnectionFactory;
|
|
|
import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer;
|
|
|
+import org.springframework.amqp.rabbit.listener.api.ChannelAwareMessageListener;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -21,15 +23,18 @@ public class Ceb311OrderListenerImpl extends RabbitMqConfig {
|
|
|
@Autowired
|
|
|
private Ceb311CustiomsResponse ceb311CustiomsResponse;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private Queue ccnetGainDeclareCspQueue;
|
|
|
+
|
|
|
/**
|
|
|
* 队列消息监听
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@Bean
|
|
|
- public SimpleMessageListenerContainer goodsCEB201MessageContainer() {
|
|
|
- SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(connectionFactory());
|
|
|
- container.setQueues(super.ccnetGainDeclareCspQueue());
|
|
|
+ public SimpleMessageListenerContainer goodsCEB201MessageContainer(ConnectionFactory connectionFactory) {
|
|
|
+ SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(connectionFactory);
|
|
|
+ container.setQueues(ccnetGainDeclareCspQueue);
|
|
|
container.setExposeListenerChannel(true);
|
|
|
container.setMaxConcurrentConsumers(1);
|
|
|
container.setConcurrentConsumers(1);
|