9 Replies Latest reply on Jul 13, 2010 11:01 PM by bjchip

    Using HAJNDI in standalone with JBoss

    bjchip

      We have discovered several advantages to a NOT so tight integration with JBoss.   Our projects and our customers wish to be able to run multiple Hornetq instances configured as clusters with HA backups spread out and maintained over the same physical hardware but not inside or affecting or affected by the JBoss clusters that we build.    The clustering and backup synch-restart requirements simply do not leave the  applications we deploy in JBoss well-enough-alone in a complex installation.

       

      Basically we want to be able to separate the two.   We've had HornetQ inside JBoss and we are pretty sure we want it outside.

       

      ((Noting (as we have noted to the customer) that for best practice we really REALLY want separate disks for the data stores in order to get the performance everyone expects))

      ____________________

       

      To do this with all the applications we have built inside JBoss clusters using HAJNDI to get their connections to Hornetq, the most appropriate and (it appears on the face of it, simplest) thing is to integrate HAJNDI with the standalone HornetQ.   I perceive a potential downside if the Hornetq arrangement is configured so that apps on a machine in the cluster wind up often using HornetQ served from some OTHER machine elsewhere in the cluster.  The potential for non-trivial slowdowns in network transport has to be considered. 

       

      So I will be trying to do this with 2.1.0 Final (or GA if that turns up soon) and JBoss 4.2.3.GA, and/or  5.1.GA ...   The immediate benefit is obvious if we are thinking of upgrades and changes.

       

      My plan at present is to use the 2.1.0.Final as a base, and pull the HAJNDI libraries and config from the specific version of JBoss that I am using rather than to try to force the JBoss into a changed HAJNDI and modify the JNDI to the HAJNDI config.

       

      With a little help from the real masters here, I will I think, refine this into a little step-by-step process. 

      ____________________________________

       

      Anyone with suggestions (or who has already done this !) please feel free to discuss.   I am only starting now, and I have a daytime project to distract and divert me :-)  

       

      Note:  There is already a discussion of integrating the standalone Hornetq with JBoss HERE

      https://community.jboss.org/message/525940#525940

       

      Hmmmm.... maybe need to make that part of the step-by-step too.  It was relatively simple but its not useful to have to pick the details out of that discussion.   Bill did us a big favour by all his hard work on that.

       

      respectfully

      BJ

        • 1. Re: Using HAJNDI in standalone with JBoss
          timfox

          BJ,

           

          I'm not sure I really understand your point about HA-JNDI. But we're currently in the process of making several improvements to HA in HornetQ, that you may be interested in.

           

          http://community.jboss.org/thread/152610?tstart=0

          • 2. Re: Using HAJNDI in standalone with JBoss
            bjchip

            JNDI  arrangements have one significant limitation, and that is their reliance on one JNDI server.   Single - Point - Failure.  Unless we configure each app with its own list of JNDI connections and  fallbacks.

             

            Internal apps on JBoss get the available apps list to/through HAJNDI.  Applications within the JBoss Cluster do not need to know anything, they simply connect through HAJNDI locally.   HAJNDI handles the distribution of its directory and the apps can find other apps to talk to throughout the cluster automatically.   Single point of configuration and distribution. 

             

            It isn't strictly speaking, an HA issue for Hornetq, but it is pretty important to ease of use for the applications in JBoss.   We were burned by having to restart whole JBoss servers when we only actually wanted to restart Hornetq, and having the same JVM serving both JBoss and Hornetq keeps us from configuring the two separately. 

             

            respectfully

            BJ

            • 3. Re: Using HAJNDI in standalone with JBoss
              timfox

              Sure, if you choose to use JNDI, then of course the JNDI needs to have no single point of failure. That's where HA-JNDI comes in.

               

              Of course, neither JNDI nor HA-JNDI are components of HornetQ, they're components of JBoss AS and have been around for a long time.

               

              Whether you decide to use JNDI or not is up to you.

               

              HornetQ provides full JMS functionality without requiring any JNDI. With JNDI you have an extra component to maintain too.

              • 4. Re: Using HAJNDI in standalone with JBoss
                bjchip

                <i>Of course, neither JNDI nor HA-JNDI are components of HornetQ, they're components of JBoss AS and have been around for a long time.</i>

                 

                I know that... but when installing the standalone Hornetq, the JNDI comes with it.  In other words, you've chosen one for me,  and it is IMHO, the less useful (but more open) choice.

                 

                Leaves me to find the appropriate HAJNDI libs and put them in place and reconfigure to do this.   Which I reckon is my job now that I've made this post and that's fine but....

                 

                It actually would be a really useful option for the standalone product.  Install it with one or the other, not both.  

                 

                It is after all, a JBoss microcontainer, so both should be available for the build.  

                 

                I know,  I can do whatever I like and nobody has to use JNDI or HAJNDI, but in actual use it makes a good deal of sense (as in, it is quite masochistic  to do anything else) to use JNDI or HAJNDI. 

                 

                One of my jobs is system administration so  I am no stranger to self-abuse, but even I draw the line at that :-)

                 

                Remains to be seen whether my daytime project is going to leave me any evenings to work in anytime soon.

                 

                respectfully

                BJ

                • 5. Re: Using HAJNDI in standalone with JBoss
                  timfox

                  BJ Chippindale wrote:

                   

                  <i>Of course, neither JNDI nor HA-JNDI are components of HornetQ, they're components of JBoss AS and have been around for a long time.</i>

                   

                  I know that... but when installing the standalone Hornetq, the JNDI comes with it.  In other words, you've chosen one for me,  and it is IMHO, the less useful (but more open) choice.

                   


                  The user manual actually says you can use HA-JNDI if you want:

                   

                  http://hornetq.sourceforge.net/docs/hornetq-2.1.0.Final/user-manual/en/html/appserver-integration.html#d0e7863

                   

                  Of course you need to install the jars from the app server, but this should be pretty straightforward

                   

                  We don't supply HA-JNDI out of the box, since HQ can do everything without needing any kind of JNDI.

                   

                   

                  BJ Chippindale wrote:

                   

                  <i>Of course, neither JNDI nor HA-JNDI are components of HornetQ, they're components of JBoss AS and have been around for a long time.</i>

                   

                  I know that... but when installing the standalone Hornetq, the JNDI comes with it.  In other words, you've chosen one for me,  and it is IMHO, the less useful (but more open) choice.

                   

                  Leaves me to find the appropriate HAJNDI libs and put them in place and reconfigure to do this.   Which I reckon is my job now that I've made this post and that's fine but....

                   

                  It actually would be a really useful option for the standalone product.  Install it with one or the other, not both.  

                   

                  It is after all, a JBoss microcontainer, so both should be available for the build.  

                   

                  I know,  I can do whatever I like and nobody has to use JNDI or HAJNDI, but in actual use it makes a good deal of sense (as in, it is quite masochistic  to do anything else) to use JNDI or HAJNDI. 

                   

                  That's your opinion, but I would disagree with it.

                   

                  I'd say it's a lot simpler not to use JNDI at all. Once less component to install, configure and worry about. With the HA improvements in 2.2 that's going to become a lot easier still.

                  • 6. Re: Using HAJNDI in standalone with JBoss
                    bjchip

                    I have to take the point of view of the app developers here, and the ability to not have to worry about where things are in the environment at that level outweighs the convenience to me of not having to configure a JNDI or HAJNDI. 

                     

                    This is a practical matter.  If I were dealing with one or two applications I might not be so inclined, but I have close to 12-15 configurables per server for 3 - 4 clustered servers  without HAJNDI and 1 common config for all of them if I use it. 

                     

                    Maybe my situation is a tad unusual.   Separate servers would handle such a menagerie in another application.  Doesn't matter.  I already signed up to do this... and thanks for the pointer :-)

                     

                    respectfully

                    BJ

                    • 7. Re: Using HAJNDI in standalone with JBoss
                      bjchip

                      I don't recall that exactly in the 2.0 manual... I am glad to be getting 2.1.0... and I am looking forward to 2.2... and I am looking over your thread about HA.  Haven't thought of anything I think I need to say yet... I thought to come back to you with this thread there  :-)   but consider that at THAT level you're right and there need be no consideration of HAJNDI or JNDI or anything else.   The bread and butter is making Hornetq Servers work as well as they can.  We'll find it.   "If we build it they will come" ;-)

                       

                      respectfully

                      BJ

                      • 8. Re: Using HAJNDI in standalone with JBoss
                        timfox

                        I'm not really sure what you think it's simpler with HA-JNDI.

                         

                        When using HA-JNDI you still need to specify either a UDP address of an initial list of servers on the client side to make the initial connection.

                         

                        With HQ it's the exact same amount of client side config.

                         

                        So the only difference is with HA-JNDI you have an extra component to install/configure/program to.

                         

                        I think really your problems revolve around limitations in HA in 2.0/2.1 like propagation of cluster topology to the client, that we're addressing in 2.2

                        • 9. Re: Using HAJNDI in standalone with JBoss
                          bjchip

                          Well... I just got stuck back into this.   Working out which jar files I need.    So far - jbossha.jar.

                           

                          As for the simplicity... hajndi doesn't have to "list" for a client living inside JBoss.   JBoss takes care of the list.   No?   We go to localhost and 1099 or whatever and there's no drama.... all I have to do is put the HQ HAJNDI on a different port and give it the appropriate cluster information and they connect.

                           

                          So.... when I put an external standalone HQ into service,  with the apps all living inside a JBoss server, they get to address the JBoss HA-JNDI service and don't need to explicitly know where the Hornetq JNDI  services are..  if the Hornetq HA-JNDI is connecting to the JBoss HA-JNDI then everyone knows where to get the hornetq messaging without playing with the individual clients.

                           

                          No matter how many clustered stand-alone live-backups I configure :-)

                           

                          respectfully

                          BJ