12.6 使用ActiveMQ消息调度延迟发送消息

博客已搬家, 更好阅读体验, 猛戳 http://www.jack-yin.com/coding/translation/activemq-in-action/1778.html

12.6 Scheduling messages to be delivered by ActiveMQ in the future

12.6 使用ActiveMQ消息调度延迟发送消息

The ability to schedule a message to be delivered after a delay, or at regular intervals,

is an extremely useful feature provided by ActiveMQ. One unique benefit is that messages

that are scheduled to be delivered in the future are stored persistently, so that

they can survive a hard failure of an ActiveMQ broker and be delivered on restart.

You specify that you want a message to be delivered at a later time by setting welldefined

properties on the message. For convenience, the well-known property names

are defined in the org.apache.activemq.ScheduledMessage interface. These properties

are shown in table 12.2.

ActiveMQ消息调度实现的消息延迟发送或者在按照固定时间的间隔实现间隔发送的功能十分有用.

其中一个独一无二的好处是消息调度设置为延迟发送的消息将会被持久化存储,因而在ActiveMQ代理

严重失效是消息不会丢失并且在代理重启后会继续发送消息.你可以通过严格定义消息的属性来设置如何

延迟发送消息.为方便起见,常用的延迟发送消息相关的属性都在org.apache.activemq.ScheduledMessage

接口中有定义,如表12.2所示.

........................

博客已搬家, 更好阅读体验, 猛戳 http://www.jack-yin.com/coding/translation/activemq-in-action/1778.html

猜你喜欢

转载自jackyin5918.iteye.com/blog/1996773