12 Replies Latest reply on Jun 16, 2008 9:55 AM by Ebenezer Samuel

    Help on JBoss Messaging

    Ebenezer Samuel Newbie

      Hi,

      I have worked in JBoss Messaging before but I am relatively new to Clustering in JBoss Messaging.

      I am trying to create distributed queues in Jboss Servers installed in different machines in a network. I went through the guide which told how to have clustered queues in the same machine.

      Does any one know where I can look for a tutorial that would help me to cluster queues across machines in a network. I apologize if I sound too silly.
      Thanks in advance.

      Regards,
      Ebe

        • 1. Re: Help on JBoss Messaging
          Ebenezer Samuel Newbie

          Any help would be greatly appreciated.

          Ebe

          • 2. Re: Help on JBoss Messaging
            Tim Fox Master

            Different machines should be pretty the same as same machine.

            • 3. Re: Help on JBoss Messaging
              Ebenezer Samuel Newbie

              Thanks Tim, for the reply.

              I have three questions and would appreciate if you could throw some light on it.

              1. Now, when I use different machines, I dont have to Uncomment binding manager service from $JBOSS_CONFIG/conf/jboss-service.xml, if I am not wrong.

              2. I see from the guide that, if there are several Jboss messaging instances running on differtent machines in the network, then when the all these instances are started using the run -c messaging, they form a partition (Default Partition). How do I customize this; I mean, how do I allow only the instances that I need, to form a partition? When I started my Jboss messaging instance, I was able to see the instances running in my co-worker's machine were also taking part in the cluster and finally he had to turn of the cluster attribute to false in his postoffice in the mysql-persistence-service.xml .

              3. I have three messaging nodes in the partition. One of the clients attached to node one is loading the queue in node one with messages. I am not sending any messages to the other two queues. However, I have three listeners (one for each node) listening to the queue. I would like to know if the messages are evenly distributed to all the queues in the partition. I am using the ClusterPullConnectionFactoryName in messaging-service.xml file.

              Thanks & Regards,
              Ebe

              • 4. Re: Help on JBoss Messaging
                Clebert Suconic Master

                 

                "ebenezerlovelin" wrote:

                1. Now, when I use different machines, I dont have to Uncomment binding manager service from $JBOSS_CONFIG/conf/jboss-service.xml, if I am not wrong.


                You don't need to use the binding manager if you are using three different machines.

                You don't need also to use the binding manager if on the same machine, if you bind each server to a different IP. On my test environment for example, I have three dumb nics working as looopback, and I can do:

                ./run.sh -c messaging -b IP

                "ebenezerlovelin" wrote:


                2. I see from the guide that, if there are several Jboss messaging instances running on differtent machines in the network, then when the all these instances are started using the run -c messaging, they form a partition (Default Partition). How do I customize this; I mean, how do I allow only the instances that I need, to form a partition? When I started my Jboss messaging instance, I was able to see the instances running in my co-worker's machine were also taking part in the cluster and finally he had to turn of the cluster attribute to false in his postoffice in the mysql-persistence-service.xml .



                You mean... having different cluster partitions?

                you can change the JGroups IP on Database-persistence.xml

                You can also pass that as a parameter on run.conf.


                "ebenezerlovelin" wrote:



                3. I have three messaging nodes in the partition. One of the clients attached to node one is loading the queue in node one with messages. I am not sending any messages to the other two queues. However, I have three listeners (one for each node) listening to the queue. I would like to know if the messages are evenly distributed to all the queues in the partition. I am using the ClusterPullConnectionFactoryName in messaging-service.xml file.
                Ebe



                You will have messages distributed to the other nodes if you don't have a local node where you're sending the message. We aways favour the local Queues first, avoiding non necessary cluster trips.

                • 5. Re: Help on JBoss Messaging
                  Ebenezer Samuel Newbie

                  Hi,
                  I was testing Queue Fail Over and I used the application-server-killer.jar and the fail over happened successfully.

                  But, when I manually (Ctrl + C) kill the server instance (node 1), the failover does not occur.

                  Is that a normal behaviour. I am just puzzled because even when I use the application-server-killer.jar the server instance is killed, it just that when I kill the instance manually (Ctrl + C), the failover does not occur.

                  Thanks & Regards,
                  Ebe

                  • 6. Re: Help on JBoss Messaging
                    Clebert Suconic Master

                    Depending on the version you're using, you will see a property FailoverOnNodeLeave on yourDB-persistence-service.xml (MessaingPostOfficeService MBean).


                    The default behavior is to only failover if a real crash happens (for instance kill -9). On older versions we only supported failover on crashes and we recently added that "feature" as per users' requests.

                    • 7. Re: Help on JBoss Messaging
                      Ebenezer Samuel Newbie

                      My JBoss AS version is 4.2.2 GA
                      The JBoss Messaging version is 1.4.0.SP3

                      Thanks & Regards,
                      Ebe

                      • 8. Re: Help on JBoss Messaging
                        Ebenezer Samuel Newbie

                        I was trying to do the following and was not able to get the desired output;

                        I have three nodes in a partition and there is one (only one) sender sending messages. I was trying to balance the load so that when the sender sends, it sends to all the three nodes equally. I mean, when there are say three messages, I wanted the sender to send one message to Queue in the node 1 and the next message to the Queue in the node 2 and the third message to the Queue in the node 3 and so on if there are more messages. Is this possible with JBoss. I have the load balancing set to true, Clustering is set to true, supports failover is set to true.

                        Thanks,
                        Ebe

                        • 9. Re: Help on JBoss Messaging
                          Clebert Suconic Master

                          We had a pretty big thread on User's forums some time ago about how clustering works.

                          http://www.jboss.com/index.html?module=bb&op=viewtopic&t=133762

                          In summary, we aways send the message to the consumers on the box where you sent the message. Having it as a single queue on the cluster wouldn't scale (simple mathematics), as you would have a single queue on the whole cluster. If you have multiple producers (one on each box), you would have the load distributed.

                          As Tim Fox pointed out on that thread, if you can't process in parallel, you can't scale up: http://en.wikipedia.org/wiki/Amdahl%27s_law.

                          • 10. Re: Help on JBoss Messaging
                            Ebenezer Samuel Newbie

                            Thank you so much for the link.

                            I am confused a lot now; I apologize for troubling you. Let me ask few things and I am sure when I get this answered, I will have the confusion cleared.

                            1. When you say

                            we aways send the message to the consumers on the box where you sent the message
                            do you mean that it is better to have two or more nodes (in that case, two or more queues) in the same Jboss Server i.e., have two or more instances, messaging-node0, messaging-node1....in the same Jboss Server in a single machine?
                            If you meant that, I have tried exactly the same thing; I have one Jboss 4.2.2 GA server with two messaging nodes, messaging-node0 and messaging-node1. Now when I send messages to one queue, I thought that the load balancer will balance the load by sending the messges to all the queues available in the cluster...in my case, the two queues. But it doesnt happen; it sends it to one queue and while in the process of sending, if the queue fails, then it sends it to the next queue.

                            2. When you say
                            If you have multiple producers (one on each box), you would have the load distributed
                            Do you mean to say that I should have NOT just one producer, but have 2 or more producers to produce messages to have the load evenly distributed? If you say yes, I am going to test with 2 or more producers(one in each node) to see if the load is balnced.

                            3. Also, while receiving or consuming, when I have 2 or more consumers (in different nodes on the cluster), will each consumer consume from the queue where the messages are queued up. Let me put it this way; I have three physical machines and three Jboss AS 4.2.2 GA, one for every machine and I have distributed queues named testDistributedQueue in all the nodes. Now, I have TWO producers(let us say, in node 1 and node 2) producing the messages to the queues (in node 1 and node 2) and THREE consumers (one in each node, 1, 2 and 3) listening to the queues.
                            3.1 While sending, will the messages be evenly sent across to all the THREE queues including the third queue (remember only TWO producers are sending the messages)
                            3.2 While consuming, will all the consumers consume evenly...

                            Thanks in advance.

                            Regards,
                            Ebe



                            • 11. Re: Help on JBoss Messaging
                              Tim Fox Master

                              Just to correct what Clebert said, since it's not quite correct.

                              JBM will not *always* send messages to local consumers, messages can also be distributed to other nodes if the local consumers are busy or non existent.

                              I'd suggest reading the documentation, and looking at other threads which have discussed this in depth.

                              • 12. Re: Help on JBoss Messaging
                                Ebenezer Samuel Newbie

                                Yes, I will go through the JBM 1.4.0 SP3 documentation.

                                Thanks a lot Tim and Clebert. I really appreciate the help you guys have done. I know I bothered you people :) thanks once again

                                Cheers,
                                Ebe