when you say you want the MDB to rol, back, do you mean that you wantthe transaction manager to roll back the transaction after n milliseconds?
As far as i can see the correct behaviour is happening, HornetQ delivers the message to the MDB as part of the transaction and the when the transaction manager rolls it back HornetQ puts it back on the queue, is this not what you want to happen?
just a note, this will happen how ever many times redeliveryAttempts is set to on the queue
Here is the scenario:
1. We have a MDB instance;
2. The MDB receives messages from queue Q1.
3. We publish a message.
4. MDB1 tries to process it, but we put a 1 hour sleep to simulate a long process
5. HornetQ cancels the transaction
6. After one hour, the message is proceesed
7. However, HornetQ redelivers the message as it knows it hasn't been processed (tx canceled)
8. ... this goes on and on, as the redelivery count is always reset to "1"
Please consider the possibilities when there are multiple MDB instances
that exactly how it should work and does. however its not HornetQ that cancels the tx its the transaction manager. if you are saying that you want the MDB to stop executing the onMessage method of the MDB then this has nothing really to do with a transaction, the tx only deals with XA resources JMS, databses etc not the mdb itself. The code in the MDB is application code and its up to the Application developer to cope with any issues they may have.
If you tell me what you are trying to acheive then maybe i can help
So how could one cope with this case, when a message could be processed over and over again ?
Implement his own message processing tracking mechanism ?
I believe this is something generic, and not a feature each developer should handle on his own.
However, this rather looks like an EJB issue - i.e. not timing out.
well this is handles by setting redelivery attempts like i said earlier. However i seemed to get the feeling that you want the MDB itself to stop executing, or am i misunderstanding you?