he.dujuan 3 gadi atpakaļ
vecāks
revīzija
4f0ca60420

+ 1 - 0
eladmin-system/src/main/java/me/zhengjie/config/rabbitmq/RabbitmqConfig.java

@@ -52,6 +52,7 @@ public class RabbitmqConfig {
         connectionFactory.setPassword(rabbitProperties.getPassword());
 //        connectionFactory.setPublisherReturns(true);
         connectionFactory.setVirtualHost(vHost);//vHost
+        connectionFactory.getRabbitConnectionFactory().setAutomaticRecoveryEnabled(true);
         return connectionFactory;
     }
     /**

+ 1 - 1
eladmin-system/src/main/java/me/zhengjie/config/rabbitmq/test/ListenerTemplate.java

@@ -41,7 +41,7 @@ public class ListenerTemplate {
 //    @Autowired
 //    DmOrderPaymentService dmOrderPaymentService;
 
-//    @RabbitListener(queues = CuisineProduce.NAME, containerFactory = CuisineProduce.LISTENER)
+    @RabbitListener(queues = CuisineProduce.NAME, containerFactory = CuisineProduce.LISTENER)
     public void dealDeclareMessage(Message message) throws UnsupportedEncodingException {
         String str = new String(message.getBody(),"utf-8");
         System.out.println("receivePc:"+str);