users@glassfish.java.net

Re: JMS: Queue-Ordering

From: Nigel Deakin <nigel.deakin_at_oracle.com>
Date: Thu, 15 Mar 2012 10:59:03 +0000

On 14/03/2012 20:21, jmilkiewicz_at_gmail.com wrote:
> @Nigel
> ... i am really surprised that it can in this way. Till now i
> lived in a word that when MDB throws a runtime exception, a message is rollbacked (not acknowledged), if it is not
> moved to dead message queue, it's re-delivery counter will be increased and finally message will be redelivered in a
> non-defined future. So basically throwing an exception or rollbacking a message will basically be the same...
> I didn't suspect some intermediate layer between broker and MDB i.e MQ client that can be controlled in some manner,
> like throwing an exception from onmessage to prevent other messages (message2, message3) to be provided to onMessage
> before the previous message (message1) is not succesfully processed or moved to dead letter queue.
> Can you tell me if this spefic MQ client behavior specific to Oracle Glassfish Server Message Queue or it is just part
> of JMS/MDB specification?

The JMS spec does describe the effect of throwing an exception and rolling back the transaction. We could have a
discussion about exactly what it requires (I think it would benefit from clarification), but the spec would would never
describe implementation details such as whether redelivery was handled by the client or the server (in fact in this case
redelivery after an exception is actually handled by the resource adapter).

Note JMS does NOT require the use of a Dead message queue - any such feature is completely non-standard.

Nigel