You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote the consumer and producer code with reference to the Quick Start code in the 5.0 documentation, and modified the producer code because of the need to send delayed messages. After the change was tested, it was found that the message was consumed without delay. This is the code I changed:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I wrote the consumer and producer code with reference to the Quick Start code in the 5.0 documentation, and modified the producer code because of the need to send delayed messages. After the change was tested, it was found that the message was consumed without delay. This is the code I changed:
Message message = provider.newMessageBuilder()
.setTopic(topic)
// 设置消息Tag,用于消费端根据指定Tag过滤消息。
.setTag("*")
// 消息体。
.setBody(body)
.setDeliveryTimestamp(l)
.build();
// 发送延迟消息
CompletableFuture sendReceiptCompletableFuture = producer.sendAsync(message);
Beta Was this translation helpful? Give feedback.
All reactions