-
1. Re: time control on retried messages
frito Jul 31, 2003 5:00 AM (in response to skely)It is configured with your invoker-proxy-binding configuration for your MDB (in standardjboss.xml or jboss.xml of your bean):
[pre]
[/pre]
Greetings,
Frito -
2. Re: time control on retried messages
genman Jul 31, 2003 6:32 PM (in response to skely)
There are a couple ways of doing this.
1. Easy: Simply call Thread.sleep if the incoming message is a redelivered message. Call getJMSRedelivered() to check for this. (In 3.2.1 there is a vendor-specific property that says how many times the message was redelivered as well, so you can have incremental delay here.)
2. Medium: In JBoss 3.2.1, set the redelivery delay property on the message before it is sent. The property is named "JMS_JBOSS_REDELIVERY_DELAY", refer to SpyMessage.java for details.
3. Medium: In 3.2.1 you can simply requeue a new message with a scheduled delivery time. Copy the message to a new JMS message and requeue it. (You lose the redelivered flag.) One obvious problem is you can't rollback container the transaction.
3. Harder: Modify JBoss. Add a method to MessageDrivenContext which takes a delay value, so calling "mdc.rollback(123)" will rollback the transaction and message, and have the message get rescheduled to be delivered in 123 milliseconds. -
3. Re: time control on retried messages
genman Jul 31, 2003 6:36 PM (in response to skely)I wrote the delivery schedule features; they may not be in 3.2.1, it will be in the official 3.2.2. 3.2.2RC1 has it, I believe.
-
4. Re: time control on retried messages
rudifr Nov 19, 2003 6:26 AM (in response to skely)How can I use the delivery schedule features? I couldn't find it in 3.2.2.
-
5. Re: time control on retried messages
genman Nov 20, 2003 1:01 AM (in response to skely)
They are done by setting message properties.
Example:
Message m = ...
m.setLongProperty("JMS_JBOSS_REDELIVERY_DELAY", 1000);
(delays the redelivery for 1 second)