9 Replies Latest reply on Aug 26, 2013 4:00 PM by soft

    JBoss 5.1.0: clustered JMS queue

    vdeminico

      Hi all,

      I have this scenario: two nodes and on both is deployed the same ear contaning a MDB; these MDBs receive messages from a clustered queue. A JMS client, active on the first node, write messages on the clustered queue.

       

      The queue is defined as follow (and deployed on both nodes):

       

         <mbean code="org.jboss.jms.server.destination.QueueService"
            name="jboss.messaging.destination:service=Queue,name=TimsocialSlowUpdateProfileQueue"
            xmbean-dd="xmdesc/Queue-xmbean.xml">
            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
            <depends>jboss.messaging:service=PostOffice</depends>
            <attribute name="Clustered">true</attribute>
         </mbean>
      
      

       

      MDB is annotated as follow:

       

       

      @MessageDriven(
                          activationConfig = { 
                                              @ActivationConfigProperty(propertyName = "destinationType",propertyValue = "javax.jms.Queue"),
                                              @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/TimsocialSlowUpdateProfileQueue")
                          },
                          mappedName="queue/TimsocialSlowUpdateProfileQueue")
      public class AsynchronousSlowAggregatorServiceBean implements MessageListener {
      
      

       

      JMS client writes messages getting a ConnectionFactory, where ConnectionFactory is the built-in connection factory (no-clusted):

       

      factory = (ConnectionFactory) ctx.lookup("ConnectionFactory");
      

       

      Problem is that messages are received only from the first MDB, which resides where the JMS client is deployed. It seems that queue is not clustered....

       

      Should I use ClusteredConnectionFactory??? I have read ClusteredConnectionFactory is used only for remote JMS client, so this is not the case.

       

      Any idea?

       

      Thanks,

      Valerio.

        • 1. Re: JBoss 5.1.0: clustered JMS queue
          wdfink

          How do you start the two nodes?

          What profile (default/all/...) do you use or have copied?

          • 2. Re: JBoss 5.1.0: clustered JMS queue
            vdeminico

            Thanks for your reply.

             

            They are both all profile.

             

            first node start script:

            run.sh -c all  -b 0.0.0.0 -g FECluster -Djboss.messaging.ServerPeerID=1

             

            second node start script

            run.sh -c all1 -Djboss.service.binding.set=ports-02  -b 0.0.0.0 -g FECluster -Djboss.messaging.ServerPeerID=2

            • 3. Re: JBoss 5.1.0: clustered JMS queue
              amathewjboss1

              Make sure you have the right value for ServerPeerID in  /opt/pvo/conf/jboss/all.pvo/deploy/messaging/messaging-service.xml

               

                    <!-- The unique id of the server peer - in a cluster each node MUST have a unique value - must be an integer -->

                    <attribute name="ServerPeerID">${jboss.messaging.ServerPeerID:0}</attribute>

               

               

              • 4. Re: JBoss 5.1.0: clustered JMS queue
                vdeminico

                Hi Anil,

                I set this value passing the paramater -Djboss.messaging.ServerPeerID to the run.sh script.

                 

                So I think that this is not the issue...

                • 5. Re: JBoss 5.1.0: clustered JMS queue
                  dasmurali

                  Check whether JBoss Messaging is in cluster or not. For this I think you can checl "PostOffice".

                   

                  Browse "jboss.messaging:service=PostOffice" MBean, you should see (at the bottom of attributees list) "NodeIDView" attribute will have values as [1,2].

                   

                  These are the ServerPeerID's that you are sending in start up scripts.

                   

                  If JBoss Messaging is in cluster. Try to stop MDB processing from the node in which your JMS client is present, then push the message and check whether message is processed by another node or not.

                  • 6. Re: JBoss 5.1.0: clustered JMS queue
                    vdeminico

                    NodeIDView is [1,2], so two nodes are in cluster.

                     

                    I have tried to stop the first node (where JMS client is...) and after that the second node process messages.... It seems that messages are processed only by local MDB. But it's strange because, if I understand well, the cluster is implemented at the queue level.

                     

                    To complete actual configuration: messaging persistence is on a shared MySql database.

                     

                    Any idea?

                    • 7. Re: JBoss 5.1.0: clustered JMS queue
                      wdfink

                      Do you try to you use 'ClusteredConnectionFactory' as you mentionend in your initial post?

                       

                      I use JmsXA, but I need XA Tx and use Topics so I don't check loadbalancing.

                      Why do you lookup instead of use injection? Do you try this?

                      • 8. Re: JBoss 5.1.0: clustered JMS queue
                        vdeminico

                        Dieter, I use lookup because the JMS client is not a JEE component, is a simple Quartz job.

                        Yes, a tried ClusteredConnectionFactory, but it's another approach... With ClusteredConnectionFactory is the Connection clustered, not the queue.

                         

                        Generally this approach is used when JMS queue is remote (and clustered), but this is not the case. Here I want a clustered queue, with messages distributed on all nodes. However when I used a ClusteredConnectionFactory it worked for a while, but then the client couldn't route the message and I receive this exception:

                         

                        javax.jms.JMSException: Failed to route Reference[20928781172555777]:RELIABLE to timsocialSlowUpdateProfileQueue

                         

                         


                        • 9. Re: JBoss 5.1.0: clustered JMS queue
                          soft

                          Hello All,

                          its quite long time but maybe somoene found the solution.

                          I have the same problem as Valerio had. All the settings and jmx-console outputs are same for me as described above. Queue still behaves as non-clustered (on Jboss 5.1).

                          Thank you,

                          Petr