users@glassfish.java.net

Re: JMS: Queue-Ordering

From: Nigel Deakin <nigel.deakin_at_oracle.com>
Date: Thu, 08 Mar 2012 11:32:10 +0000

Patrick,

Asking your question here is fine :-)

Please help me understand your question:

You have a single MDB instance processing messages from a queue.
The MDB receives message 1. This calls setRollbackOnly() and returns.

You are reporting that the MDB does not receive message 1 again (which is the behaviour you want) but instead receives
message 2 and then message 3.

Have I got this right?

Does message 1 get redelivered eventually?

Nigel


On 07/03/2012 13:13, forums_at_java.net wrote:
> Hi all,
>
> I'm currently evaluating glassfish and its jms-component for a project where
> two requirements have to be fullfilled. The queue has to be orderd and there
> may be only one consumer. This is important since messages might depend on
> each other.
>
> By configuring a singleton-bean-pool I currently have one MDB processing the
> messages, wich is quite good but has one bad issue: I have to query an
> external resource and this query might fail. It is unlikely, but possible,
> that a couple of messages are delivered to the queue and the first one fails
> to query the external resource. In that case I want to abort and reprocess
> this "message 1" until it succeeds and I do NOT want to process "message 2"
> or even "message 3", which made it to the queue as well.
>
> However, that's precisely that happens when I detect the issue and invoke
> "mdc.setRollbackOnly();" on "message 1".
>
> I should be able to dodge MDB and instead create a standalone-client
> performing the required processing. However, I'm not sure that would solve
> the ordering issue? And since it would be very closely coupled, a
> MDB-solution would be the preferred option. Or there might be
> options/properties of queues in Glassfish which I'm not aware of yet. Or I
> might have to evaluate alternatives, but that would be the worst option. :-(
>
> I'm quite confused by the available glassfish-homepages and available
> documentation, quite a lot of links are leading to non-existent URLs. Looks
> like quite a bit of documentation still has issues with Oracle aquiring Sun?
> I'm not even sure I'm asking in the right forum, so feel free to give me some
> kicking, as long as you point me in the right direction. ;-)
>
> Yours,
>
> Patrick.
>
>
> --
>
> [Message sent by forum member 'pvdh']
>
> View Post: http://forums.java.net/node/884067
>
>