...
Table of Contents | ||
---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
When a topic has one or more subscriptions and when you need to apply a global delay to all the subscriptions of it, you can set it up in the broker by defining global policies.
Setting up delayed delivery for subscribers
The client who connects can override the global policies you set up for topics. When configuring the java.naming.provider.url
parameter in the JMS Inbound Endpoint, you can pass the re-delivery policy property as a query String. For a detailed description on the policy properties, go to Apache ActiveMQ Documentation.
...
Code Block | ||||
---|---|---|---|---|
| ||||
<inboundEndpoint name="MARSInboundEP" onError="MARSEPErrorSeq" protocol="jms" sequence="ProcessOrderSeq" suspend="false"> <parameters> ....... <parameter name="java.naming.provider.url">tcp://localhost:61616?jms.redeliveryPolicy.redeliveryDelay=1000&jms.redeliveryPolicy.maximumRedeliveries=4</parameter> ...... </parameters> </inboundEndpoint> |
Enforcing a delay per message
There are not an out of the box feature available in ActiveMQ to enforce delay per message. The re-delivery policies are defined by the Initial Context Factory when it establishes the connection and it does not happen on a per message basis.
However, before rolling back, you can enforce a delay using the Script mediator in the error sequence as follows.
...