@Test public void testSyncSend() throws InterruptedException { for (int id = 1; id <= 2; id++) { producer.syncSend(id); logger.info("[testSyncSend][发送编号：[{}] 发送成功]", id); } new CountDownLatch(1).await(); }
public void syncSend(Integer id) { Demo12Message message = new Demo12Message(); message.setId(id); rabbitTemplate.convertAndSend(Demo12Message.EXCHANGE, Demo12Message.ROUTING_KEY, message); }
Demo12Producer { public void syncSend(Integer id) { Demo12Message message = new Demo12Message(); message.setId(id); rabbitTemplate.convertAndSend(Demo12Message.EXCHANGE, Demo12Message.ROUTING_KEY, message); } }
Demo12Producer { public void syncSend(Integer id) { Demo12Message message = new Demo12Message(); message.setId(id); rabbitTemplate.convertAndSend(Demo12Message.EXCHANGE, Demo12Message.ROUTING_KEY, message); }  }
Demo12Producer { public void syncSend(Integer id) { Demo12Message message = new Demo12Message(); message.setId(id); rabbitTemplate.convertAndSend(Demo12Message.EXCHANGE, Demo12Message.ROUTING_KEY, message); }  void syncSend(Integer id); }
Demo12Producer { public void syncSend(Integer id) { Demo12Message message = new Demo12Message(); message.setId(id); rabbitTemplate.convertAndSend(Demo12Message.EXCHANGE, Demo12Message.ROUTING_KEY, message); }  void syncSend(Integer id);  }