@Test public void testSyncSendDelay() throws InterruptedException { int id = (int) (System.currentTimeMillis() / 1000); SendResult result = producer.syncSendDelay(id, 3); logger.info("[testSyncSendDelay][发送编号：[{}] 发送结果：[{}]]", id, result); new CountDownLatch(1).await(); }
public SendResult syncSendDelay(Integer id, int delayLevel) { Message message = MessageBuilder.withPayload(new Demo03Message().setId(id)) .build(); return rocketMQTemplate.syncSend(Demo03Message.TOPIC, message, 30 * 1000, delayLevel); }
Demo03Producer { public SendResult syncSendDelay(Integer id, int delayLevel) { Message message = MessageBuilder.withPayload(new Demo03Message().setId(id)) .build(); return rocketMQTemplate.syncSend(Demo03Message.TOPIC, message, 30 * 1000, delayLevel); } }
Demo03Producer { public SendResult syncSendDelay(Integer id, int delayLevel) { Message message = MessageBuilder.withPayload(new Demo03Message().setId(id)) .build(); return rocketMQTemplate.syncSend(Demo03Message.TOPIC, message, 30 * 1000, delayLevel); }  }
Demo03Producer { public SendResult syncSendDelay(Integer id, int delayLevel) { Message message = MessageBuilder.withPayload(new Demo03Message().setId(id)) .build(); return rocketMQTemplate.syncSend(Demo03Message.TOPIC, message, 30 * 1000, delayLevel); }  SendResult syncSendDelay(Integer id, int delayLevel); void asyncSendDelay(Integer id, int delayLevel, SendCallback callback); }
Demo03Producer { public SendResult syncSendDelay(Integer id, int delayLevel) { Message message = MessageBuilder.withPayload(new Demo03Message().setId(id)) .build(); return rocketMQTemplate.syncSend(Demo03Message.TOPIC, message, 30 * 1000, delayLevel); }  SendResult syncSendDelay(Integer id, int delayLevel); void asyncSendDelay(Integer id, int delayLevel, SendCallback callback);  }