users@glassfish.java.net

Re: Problem with topic MDB in a cluster env

From: <glassfish_at_javadesktop.org>
Date: Wed, 30 Apr 2008 11:33:59 PDT

No, this does not work at all, here is the part of the link that describe the topic MDB:

"The Application Server transparently enables messages to be delivered in random fashion to message-driven beans having same ClientID. The ClientID is required for durable subscribers.

For nondurable subscribers in which the ClientID is not configured, all instances of a specific message-driven bean that subscribe to same topic are considered equal. When a message-driven bean is deployed to multiple instances of the Application Server, only one of the message-driven beans receives the message. If multiple distinct message-driven beans subscribe to same topic, one instance of each message-driven bean receives a copy of the message."

So, first solution is to used durable message with unique clientID. OK, I created a new MDB to listen to the same topic but has different ClientID annotation, well, it worked, both MDB got the same message. But here is the question of this approach, how do you deploy the same EAR on the DAS that will render the MDB in the cluster instance with different clientID, if the MDB is injected with the same annotation?

The 2nd approach is to use none durable message, so I use this annotation in the MDB instead:

@ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue="NonDurable")

I cleaned up the JMS, shutdown and restarted all servers, but the message still sending to only one MDB among the 2 instances.

Form the last paragraph of the document, it seem to me that the message will only be sent to one instance of the MDB of the same type (or with same clientID).
So again I ask, how can I publish a topic message that an be received by the MDB in all cluster instances?
[Message sent by forum member 'evanyang168' (evanyang168)]

http://forums.java.net/jive/thread.jspa?messageID=272282