検索

このコンテンツは選択した言語では利用できません。

Chapter 13. Scheduling Messages

download PDF

You can specify a time in the future, at the earliest, for a message to be delivered. This can be done by setting the _AMQ_SCHED_DELIVERY scheduled delivery property before the message is sent.

The specified value must be a positive long that corresponds to the time in milliseconds for the message to be delivered. Below is an example of sending a scheduled message using the JMS API.

// Create a message to be delivered in 5 seconds
TextMessage message = session.createTextMessage("This is a scheduled message message that will be delivered in 5 sec.");
message.setLongProperty("_AMQ_SCHED_DELIVERY", System.currentTimeMillis() + 5000);
producer.send(message);

...

// The message will not be received immediately, but 5 seconds later
TextMessage messageReceived = (TextMessage) consumer.receive();

Scheduled messages can also be sent using the core API by setting the _AMQ_SCHED_DELIVERY property before sending the message.

Red Hat logoGithubRedditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

© 2024 Red Hat, Inc.