@Test public void testSendMessageInTransaction() throws InterruptedException { int id = (int) (System.currentTimeMillis() / 1000); SendResult result = producer.sendMessageInTransaction(id); logger.info("[testSendMessageInTransaction][发送编号：[{}] 发送结果：[{}]]", id, result); new CountDownLatch(1).await(); }
public TransactionSendResult sendMessageInTransaction(Integer id) { Message<Demo07Message> message = MessageBuilder.withPayload(new Demo07Message().setId(id)) .build(); return rocketMQTemplate.sendMessageInTransaction(TX_PRODUCER_GROUP, Demo07Message.TOPIC, message, id); }
Demo07Producer { public TransactionSendResult sendMessageInTransaction(Integer id) { Message<Demo07Message> message = MessageBuilder.withPayload(new Demo07Message().setId(id)) .build(); return rocketMQTemplate.sendMessageInTransaction(TX_PRODUCER_GROUP, Demo07Message.TOPIC, message, id); } }
Demo07Producer { public TransactionSendResult sendMessageInTransaction(Integer id) { Message<Demo07Message> message = MessageBuilder.withPayload(new Demo07Message().setId(id)) .build(); return rocketMQTemplate.sendMessageInTransaction(TX_PRODUCER_GROUP, Demo07Message.TOPIC, message, id); }  }
Demo07Producer { public TransactionSendResult sendMessageInTransaction(Integer id) { Message<Demo07Message> message = MessageBuilder.withPayload(new Demo07Message().setId(id)) .build(); return rocketMQTemplate.sendMessageInTransaction(TX_PRODUCER_GROUP, Demo07Message.TOPIC, message, id); }  TransactionSendResult sendMessageInTransaction(Integer id); }
Demo07Producer { public TransactionSendResult sendMessageInTransaction(Integer id) { Message<Demo07Message> message = MessageBuilder.withPayload(new Demo07Message().setId(id)) .build(); return rocketMQTemplate.sendMessageInTransaction(TX_PRODUCER_GROUP, Demo07Message.TOPIC, message, id); }  TransactionSendResult sendMessageInTransaction(Integer id);  }