It is configured with your invoker-proxy-binding configuration for your MDB (in standardjboss.xml or jboss.xml of your bean):
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.
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.
How can I use the delivery schedule features? I couldn't find it in 3.2.2.
They are done by setting message properties.
Message m = ...
(delays the redelivery for 1 second)