1 2 3 Previous Next 32 Replies Latest reply on Jul 22, 2011 2:08 PM by pczeus Go to original post
      • 15. Re: Cannot configure a UDP based cluster for a JBoss embedded HornetQ.
        swapnonil.mukherjee

        Hi Tim

        Get some caffeine or nicotine

         

        People do read documentation.

         

        I have read that piece  http://hornetq.sourceforge.net/docs/hornetq-2.0.0.GA/user-manual/en/html_single/index.html#clusters-discovery.groups.clientside over and over again.

         

        My last question was actually regarding a section in this documentation, Please allow me to quote " There is also a further parameter settable on the connection factory using the setter method setInitialWaitTimeout()".

         

        Now my problem is, I cannot find that method. Could you please tell me where and in which class this method is defined, so that I could read the API and use it?

         

        I have come very close to configuring a cluster. It is just the client look up mechanism that is failing.

        I have 2 connection factories.

        1. ConnectionFactory which is a simple connection factory
        2. ClusteredConnectionFactory which references a discovery group named "dg-group1".

         

        I can look up the connection factory named "ConnectionFactory" using JNDI but then I have to hard code the IP for this lookup.But once I get the reference to this connection factory and post 100 messages, it is distributed symmetrically across 2 servers. That is, 50 goes to 1 and the 50 goes to the other. So my symmetric cluster set up is working. No problem at all.

         

        But when I use try to use JNDI to lookup "ClusteredConnectionFactory", I get a "Timed out waiting to receive initial broadcast from discovery group" exception. Clebert suggested that I use the Non-JNDI method of look up. I quite like the NON JNDI method as I don't have to hard code the IP address of the lookup server like in the case of JNDI. So I tried the following.

         

        ConnectionFactory cf = HornetQJMSClient.createConnectionFactory("224.0.0.1",9876);
        Queue queue = HornetQJMSClient.createQueue(destinationName);
        
        Connection connection = cf.createConnection(); 
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        MessageProducer publisher = session.createProducer(queue);
        

         

        But even then the look up fails on the third line the line annotated with me in tears. The exception is the same "Timed out waiting to receive initial broadcast from discovery group".

         

         

        So the problem is with the client lookup portion only. Should I start a separate forum thread?

         

        And Thank you very much in helping me understanding the UDP issues.

        • 16. Re: Cannot configure a UDP based cluster for a JBoss embedded HornetQ.
          timfox

          For a start, JNDI is *not part of HornetQ* and does not use UDP anyway, so the JNDI is a red-herring.

           

          Since I seem to be everyone's personal secretary search engine these days, the param on the connection factory would be obvious if you looked at the class:

           

          http://anonsvn.jboss.org/repos/hornetq/tags/HornetQ_2_0_0_GA/src/main/org/hornetq/jms/client/HornetQConnectionFactory.java

           

          public synchronized long getDiscoveryInitialWaitTimeout()
             {
                return sessionFactory.getDiscoveryInitialWaitTimeout();
             }

             public synchronized void setDiscoveryInitialWaitTimeout(final long discoveryInitialWaitTimeout)
             {
                checkWrite();
                sessionFactory.setDiscoveryInitialWaitTimeout(discoveryInitialWaitTimeout);
             }

          Also, this is in the appendix at the end of the user manual:

          http://hornetq.sourceforge.net/docs/hornetq-2.0.0.GA/user-manual/en/html_single/index.html#d0e11875

          "connection-factory.discovery-initial-wait-timeout"

          You can set this direct on the connection factory if you are using JNDI, like any property.



          • 17. Re: Cannot configure a UDP based cluster for a JBoss embedded HornetQ.
            timfox

            Swapnonil Mukherjee wrote:

             

            Hi Tim

            Get some caffeine or nicotine

             

             

            I'm not sure stimulants will really help though

             

            I don't mean to come over as rude, but honestly, I spend about 2 hours per day pointing people to parts of the documentation, pointing them to JIRA, or pointing to another thread where the same thing has been discussed, usual the same issues again and again and again.

             

            I'm sure you can understand it gets quite frustrating sometimes.

            • 18. Re: Cannot configure a UDP based cluster for a JBoss embedded HornetQ.
              swapnonil.mukherjee

              Hi Tim,

               

              I do understand your situation and I am very thankful to you for helping me out.

               

              But the reason I could not find the method is because of the incorrect documentation. Allow me to explain.

               

              The documentation of HornetQ Manual on page 156 and 157 mentions the name of the method as setInitialWaitTimeout(). The actual name of the method is setDiscoveryInitialWaitTimeout(..). Which is why I spent about an hour searching for it in vain.

               

              Please update the documentation on page number 156 and 157 with the correct method name.

              • 19. Re: Cannot configure a UDP based cluster for a JBoss embedded HornetQ.
                swapnonil.mukherjee

                Hi Tim,

                 

                I am stuck where I was about 2 days ago. Even after setting the setDiscoveryInitialWaitTimeout(5000) like this

                 

                HornetQConnectionFactory cf = new HornetQConnectionFactory("224.0.0.1", 9876);
                cf.setDiscoveryInitialWaitTimeout(5000);
                

                 

                I am still getting the same error. I also tried the JNDI route by setting the connection-factory.discovery-initial-wait-timeout in my hornetq-jms.xml. But I get the same error again

                that is "Timed out waiting to receive initial broadcast from discovery group".

                 

                There must be a reason behind this. As I told you earlier my cluster seems to be set up okay.

                It is just that this client look up that is failing.

                 

                Is there any way I could get over this problem?

                • 20. Re: Cannot configure a UDP based cluster for a JBoss embedded HornetQ.
                  timfox

                  Are you sure UDP is enabled on your client machine?

                   

                  If you can post a runnable test program (not just a snippet) that can be run on the client machine, along with exact config from your server machines, we can take a look.

                  • 21. Re: Cannot configure a UDP based cluster for a JBoss embedded HornetQ.
                    swapnonil.mukherjee

                    Ok, do we need on UDP on the client machine, from where I am running my client program as well?

                     

                    I am running my client program from my Windows box. It is in the same network that these UDP enabled RHEL servers (on which I have configured the clusters)  are on.

                     

                    But I know for sure that UDP is not enabled on this Windows box. When I ping 224.0.0.1 from the Windows box I get reply from only a single PC. However when I ping 224.0.0.1 from the RHEL servers that is either from 10.1.0.74 or 10.1.0.39 I get response from all the servers in network that belong to this UPD group. Which is why 74 knows about 39 and vice versa.

                    • 22. Re: Cannot configure a UDP based cluster for a JBoss embedded HornetQ.
                      clebert.suconic

                      If you use UDP discovery, you need UDP at the clients that are doing the UDP discovery as well.

                      • 23. Re: Cannot configure a UDP based cluster for a JBoss embedded HornetQ.
                        jmesnil

                        Swapnonil Mukherjee wrote:

                         

                        Please update the documentation on page number 156 and 157 with the correct method name.

                        Documentation has been updated with the correct name after 2.0.0 release.

                        • 24. Re: Cannot configure a UDP based cluster for a JBoss embedded HornetQ.
                          swapnonil.mukherjee

                          Thanks Clebert, That solved my problem finally.

                           

                          When I ran my client code from a UDP enabled linux box it worked beautifully.

                          • 25. Re: Cannot configure a UDP based cluster for a JBoss embedded HornetQ.
                            pczeus

                            Wow Tim, sometimes I'm shocked at how abrasive you are sometimes...you can be a real donkey synonym sometimes.

                            I've read the entire documentation several times and love HornetQ, but I can tell you the docs are not that great and it's not always easy to find what you are looking for. Relax bro, newbies are part of the job.

                            • 26. Re: Cannot configure a UDP based cluster for a JBoss embedded HornetQ.
                              clebert.suconic

                              huh? What was that about?

                               

                              You are saying 1.5 years after the last post?

                               

                              Tim is not working at RedHat any longer... but he's still a friend contributing here on the forum.

                               

                              Are you having an issue?

                              • 27. Re: Cannot configure a UDP based cluster for a JBoss embedded HornetQ.
                                clebert.suconic

                                BTW: The docs are better than most Messaging providers I have seen (talking about the paid ones).

                                 

                                 

                                Now.. having said that.. we're always looking for ways to improve it... (you can either point deficiencies.. or contribute text ;-) )

                                • 28. Re: Cannot configure a UDP based cluster for a JBoss embedded HornetQ.
                                  pczeus

                                  Nah...as I said, i love HornetQ.

                                  Tim is a great asset to you guys and honestly brilliant.

                                  I only made the comment because while during searches on the forums, I have run into several instances of 'negative' responses like this and it makes people (including myself) afraid to post a question for fear of getting a response like that.

                                   

                                  For people trying to get Jboss and/or HornetQ up and running for the first time, it's a tough experience and they are going to ask basic (sometimes dumb) , repetitive questions. Driving them away from posting questions for fear of the response is not what I think the JBoss community wants to promote.

                                   

                                  So, like Tim has done sometimes, I just turned off my filter and posted what I was thinking and not necessarily what should be made public

                                   

                                  But I will say it one more time...I love HornetQ, use it in a multi clustered production application environment and Tim is one sharp dude.

                                   

                                  Dave

                                  • 29. Re: Cannot configure a UDP based cluster for a JBoss embedded HornetQ.
                                    clebert.suconic

                                    Well, even Tim would recognize (when I was still working with him) that I'm nicer with newbie users.

                                     

                                    ...and I have been trying to be a bit more relaxed with newbie questions.

                                     

                                    Only exception is when users starting trolling instead of making real questions..   but I only remember a handful cases like these.

                                    (you know, troll users are part of the internet culture).

                                     

                                     

                                    I try to be as cool as a brazilian here 8-)

                                     

                                    I suck at playing soccer (as I'm a brazilian nerd).. but at least I can use some bossa nova and just relax and taking easy with newbie questions ;-)

                                     

                                     

                                    Only thing I do eventually is point to the manual as I don't want to retype what's on the manuals. or tell users where to find info (that will encourage users to read the manual.. as nobody ever has all the resources he wants). Our resources here are limited as in any other project.