users@glassfish.java.net

RE: How can all of the same subscribers in different instance get the meesages?

From: weiqiang tang <shockwave_115_at_hotmail.com>
Date: Thu, 31 Dec 2009 09:34:32 +0000

Just found solution in http://forums.java.net/jive/thread.jspa?messageID=367045

 

And I can just set "useSharedSubscriptionInClusteredContainer=false" for non-durable subscriptions in a clustered container.


BRs

//FD

 


From: shockwave_115_at_hotmail.com
To: users_at_glassfish.dev.java.net
Date: Thu, 31 Dec 2009 09:18:57 +0000
Subject: How can all of the same subscribers in different instance get the meesages?



Hi

I am using MDB to recieve messages from publisher, used for event and notification, I deploy same MDB into different instance, if there is a event, the publisher will publish a message, and all subscribers in different instance are supposed to get the message, but reffer to the message flow, only one of these MDB will recieve the messages.
One solution is to have different clientID for these MDB in different instances. But unfortunately, the value for clientId should be constant expression.
Here is my code, any suggestion?
@MessageDriven(mappedName = "cluster_publisher_adm", activationConfig =
{
 @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
 @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable"),
 @ActivationConfigProperty(propertyName = "clientId", propertyValue = "test"),
        @ActivationConfigProperty(propertyName = "subscriptionName", propertyValue = "myTest"),
 @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic") })
public class TopicListener implements MessageListener {
    /**
     *
     */
    public TopicListener() {
 
    }
...
How can I have all the MDB in different instances to get the same messages?
 
BRs
//FD



Windows Live: Keep your friends up to date with what you do online.
_________________________________________________________________
Windows Live: Make it easier for your friends to see what you¡¯re up to on Facebook.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_2:092009