Release Notes
Announcements
__STARTDELIVERTIME value to the property of the message. For delayed messages, you can first calculate the scheduled delivery timestamp and then send them as scheduled messages.System.currentTimeMillis() + delayTime and then send them as scheduled messages.Message msg = new Message("test-topic", ("message content").getBytes(StandardCharsets.UTF_8));// Set the message to be sent 10 seconds later.long delayTime = System.currentTimeMillis() + 10000;// Set __STARTDELIVERTIME into the property of msg.msg.putUserProperty("__STARTDELIVERTIME", String.valueOf(delayTime));SendResult result = producer.send(msg);System.out.println("Send delay message: " + result);
Duration messageDelayTime = Duration.ofSeconds(10); final Message message = provider.newMessageBuilder() // Set topic for the current message. .setTopic(topic) // Message secondary classifier of message besides topic. .setTag(tag) // Key(s) of the message, another way to mark message besides message id. .setKeys("yourMessageKey-3ee439f945d7") // Set expected delivery timestamp of message. .setDeliveryTimestamp(System.currentTimeMillis() + messageDelayTime.toMillis()) .setBody(body) .build();
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan