@Test public void nothing02() throws InterruptedException { for (int i = 0; i < 1000; i++) { int id = (int) (System.currentTimeMillis() / 1000); producer.syncSend(id); logger.info("[testSyncSend][发送编号：[{}] 发送成功]", id); Thread.sleep(5000L); } new CountDownLatch(1).await(); }
public void syncSend(Integer id) { Demo01Message message = new Demo01Message(); message.setId(id); rabbitTemplate.convertAndSend(Demo01Message.EXCHANGE, Demo01Message.ROUTING_KEY, message); }
Demo01Producer { public void syncSend(Integer id) { Demo01Message message = new Demo01Message(); message.setId(id); rabbitTemplate.convertAndSend(Demo01Message.EXCHANGE, Demo01Message.ROUTING_KEY, message); } }
Demo01Producer { public void syncSend(Integer id) { Demo01Message message = new Demo01Message(); message.setId(id); rabbitTemplate.convertAndSend(Demo01Message.EXCHANGE, Demo01Message.ROUTING_KEY, message); }  }
Demo01Producer { public void syncSend(Integer id) { Demo01Message message = new Demo01Message(); message.setId(id); rabbitTemplate.convertAndSend(Demo01Message.EXCHANGE, Demo01Message.ROUTING_KEY, message); }  void syncSend(Integer id); void syncSendDefault(Integer id); @Async ListenableFuture<Void> asyncSend(Integer id); }
Demo01Producer { public void syncSend(Integer id) { Demo01Message message = new Demo01Message(); message.setId(id); rabbitTemplate.convertAndSend(Demo01Message.EXCHANGE, Demo01Message.ROUTING_KEY, message); }  void syncSend(Integer id); void syncSendDefault(Integer id); @Async ListenableFuture<Void> asyncSend(Integer id);  }