10 Replies Latest reply on Feb 9, 2004 12:19 AM by ivelin.ivanov

    JMS Clustering for JBoss 3.2

    ivelin.ivanov

       

      "ivelin" wrote:
      "ivelin" wrote:

      Thanks to Adrian who met with me in Austin a few days ago and gave me valuable insight on JBossMQ, I was able to resume work on HA JMS.

      An early experimental HA JMS service is now available for testing.
      http://cocoonhive.org/jboss/HAJMS.zip

      Building upon UIL2, this is a singleton server implementation, which is useful for a lot of practical purposes. All clients automatically connect to the singleton server.

      Fail-over is not automated. Clients should register Connection ExceptionListener to be notified when the singleton moves to another node. When this happens, the clients should reconnect.

      More information and documentation will be coming out in the following days.
      Stay tuned to this thread.

      Feedback is welcome!

      Ivelin


        • 1. Re: JMS Clustering for JBoss 3.2
          bill.burke

           

          "Bill Burke" wrote:
          "Bill Burke" wrote:
          You can handle durable connections seemlessly? What about secure connections (user/passwd) I don't remember exactly, but I remember that it was virtually impossible to have JMS connections with failover because of the way theframework handled things. What scenarios/use cases have you tested for?

          Bill


          • 2. Re: JMS Clustering for JBoss 3.2
            ivelin.ivanov

             

            "ivelin" wrote:
            "ivelin" wrote:
            No. On Fail-over undelivered messages may be lost.
            I'll post a doc with more details.


            • 3. Re: JMS Clustering for JBoss 3.2
              ivelin.ivanov

               

              "ivelin" wrote:
              "ivelin" wrote:
              A more in-depth document on the implementation:
              http://www.cocoonhive.org/articles/jboss/20031125/JBoss32-hajms.html


              • 4. Re: JMS Clustering for JBoss 3.2

                 

                "adrian@jboss.org" wrote:
                "adrian@jboss.org" wrote:
                Hi Ivelin,

                Some questions about the docs:

                1) In the connectivity section you state only nodes in the
                cluster can get access to HAJMS.
                Why can't they just lookup using the jndi of the remote
                cluster.
                If they use HAJNDI of the remote cluster they
                will easily locate where the singleton exists.
                If it is part way through a move, they may need to retry.
                This processing is already in the jboss MDB

                2) In the failover section you state that "undelivered" messages
                may be lost.
                This is to be expected for non-persistent
                messages or non-durable topic subscriptions. There are
                no guarantees for these.

                For durable subscriptions the undelivered messages
                won't be lost provided the failover jms can access the same db.
                It will recover the messages from the db when the
                persistence manager starts.
                This assumes you can make use of the jdbc statemanager
                rather than the file version (the default).
                The jdbc statemanager will store the
                durable subscriptions in the db rather than jbossmq-state.xml

                The jdbc statemanager needs some work to allow users/roles/
                subscriptions to be manipulated in the db using jmx.

                Regards,
                Adrian


                • 5. Re: JMS Clustering for JBoss 3.2
                  ivelin.ivanov

                   

                  "ivelin" wrote:
                  "ivelin" wrote:

                  Thanks for the comments Adrian.

                  Your proposed solutions sound reasonable for both 1) and 2).
                  However I have not tested these scenarios, therefore I chose to safely list them as limitations.

                  I will add your comments to the document.

                  Ivelin


                  • 6. Re: JMS Clustering for JBoss 3.2
                    ivelin.ivanov

                     

                    "ivelin" wrote:
                    "ivelin" wrote:
                    HA JMS is now in Branch 3.2 and will be released with JBoss 3.2.3RC2.

                    Help us test it.
                    Report problems on this thread.

                    Ivelin


                    • 7. Re: JMS Clustering for JBoss 3.2
                      jkharness87

                       

                      "jkharness87" wrote:
                      "jkharness87" wrote:
                      I tried accessing the HA JMS from a client that was not in the cluster (through a jndi lookup as Adrian suggested). I haven't had much luck, though. I'm not sure if it is my own fault or simply that this is so new (Ivelin indicated that he wasn't so confident that the non-clustered client would work with this).

                      Nonetheless, here is a summary of my exceptions and my attempts to fix them:

                      At first I got the following:

                      javax.naming.NamingException: Invalid reference. Error: org.jboss.mq.il.ha.HAILServerIL (no security manager: RMI class loader disabled)
                      at org.jboss.mq.referenceable.ObjectRefAddr.extractObjectRefFrom(ObjectRefAddr.java:82)
                      at org.jboss.mq.referenceable.SpyConnectionFactoryObjectFactory.getObjectInstance(SpyConnectionFactoryObjectFactory.java:48)
                      at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301)
                      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:620)
                      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
                      at javax.naming.InitialContext.lookup(InitialContext.java:347)
                      at HATest.connect(HATest.java:54)
                      at HATest.main(HATest.java:20)
                      java.lang.NullPointerException
                      at HATest.connect(HATest.java:55)
                      at HATest.main(HATest.java:20)


                      So, I added the jbossmq-hail.jar to my classpath. Then I got the following:

                      java.lang.NoClassDefFoundError: javax/management/NotificationListener
                      at java.lang.ClassLoader.defineClass0(Native Method)
                      at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
                      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
                      at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
                      at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
                      at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
                      at java.security.AccessController.doPrivileged(Native Method)
                      at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
                      at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
                      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
                      at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
                      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
                      at java.lang.Class.forName0(Native Method)
                      at java.lang.Class.forName(Class.java:219)
                      at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:154)
                      at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:631)
                      at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:257)
                      at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:200)
                      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1513)
                      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
                      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
                      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
                      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
                      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
                      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
                      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
                      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
                      at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
                      at org.jboss.mq.referenceable.ObjectRefAddr.extractObjectRefFrom(ObjectRefAddr.java:80)
                      at org.jboss.mq.referenceable.SpyConnectionFactoryObjectFactory.getObjectInstance(SpyConnectionFactoryObjectFactory.java:48)
                      at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301)
                      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:620)
                      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
                      at javax.naming.InitialContext.lookup(InitialContext.java:347)
                      at HATest.connect(HATest.java:54)
                      at HATest.main(HATest.java:20)
                      java.lang.NullPointerException
                      at HATest.connect(HATest.java:55)
                      at HATest.main(HATest.java:20)


                      I wasn't real sure why, but it seemed lke it wanted the jmx stuff. So, I added the jboss-jmx.jar to my classpath. I then got the following:

                      org.jboss.mq.SpyJMSException: Cannot authenticate user; - nested throwable: (java.lang.IllegalStateException: No 'jboss' MBeanServer found!)
                      at org.jboss.mq.Connection.authenticate(Connection.java:883)
                      at org.jboss.mq.Connection.<init>(Connection.java:238)
                      at org.jboss.mq.Connection.<init>(Connection.java:315)
                      at org.jboss.mq.SpyConnection.<init>(SpyConnection.java:60)
                      at org.jboss.mq.SpyConnectionFactory.createQueueConnection(SpyConnectionFactory.java:116)
                      at HATest.connect(HATest.java:55)
                      at HATest.main(HATest.java:20)
                      Caused by: java.lang.IllegalStateException: No 'jboss' MBeanServer found!
                      at org.jboss.mx.util.MBeanServerLocator.locateJBoss(MBeanServerLocator.java:46)
                      at org.jboss.mq.il.ha.HAILServerIL.createConnection(HAILServerIL.java:102)
                      at org.jboss.mq.il.uil2.UILServerIL.getSocketMgr(UILServerIL.java:500)
                      at org.jboss.mq.il.uil2.UILServerIL.authenticate(UILServerIL.java:302)
                      at org.jboss.mq.Connection.authenticate(Connection.java:876)
                      ... 6 more


                      Looks like I'm going to have to cluster a session bean that can then utilize the HA JMS since it'll be a part of the cluster (and have the client talk to the clustered session bean). I was under the impression that it should work just like looking up "ConnectionFactory" from jndi without any new classes being in my path (of course I'm looking up "HAILConnectionFactory" here). I could just be acting like an idiot, though. Any ideas? This stuff is so new and I haven't seen any real comments from people on the message boards.

                      Josh




                      • 8. Re: JMS Clustering for JBoss 3.2
                        ivelin.ivanov

                         

                        "ivelin" wrote:
                        "ivelin" wrote:
                        this question will be addressed on the Clustering Users forum.
                        http://jboss.org/index.html?module=bb&op=viewtopic&t=43598


                        • 9. Re: JMS Clustering for JBoss 3.2
                          dsambandan

                           

                          "ivelin" wrote:
                          "ivelin" wrote:
                          "ivelin" wrote:
                          HA JMS is now in Branch 3.2 and will be released with JBoss 3.2.3RC2.

                          Help us test it.
                          Report problems on this thread.

                          Ivelin



                          Ivelin
                          Is it possible to provide a singleton service for JMS Destinations (queue/Topic) also ?

                          Example scenario :

                          1) Two clustered node with identical setup
                          2) JMS Persistent Manager in both the node points to same database tables (JMS_MESSAGES & JMS_TRANSACTIONS).
                          3) When the Nodes are started, Connection Factory (HAIL) will be available only in one server but the destinations(Queue) will be active in both the nodes.

                          The problem in having destination active in both the nodes is that, if there are any pending messages in the database then they will get de-queued by both the nodes during startup. So if we implement a Singleton service for Queues/Topics, we can overcome this issue. i.e. Queue/Topic will be available only in one node and whenever a node crashes then the other node can become a singleton and start the Queue/Topic( Destination). All the clients can use HA JNDI to access the queue.

                          Please correct me if am i wrong

                          Thanks & Regards
                          Devaraj

                          • 10. Re: JMS Clustering for JBoss 3.2
                            ivelin.ivanov

                            Devaraj,

                            This is one of the requirements for the new JBoss/JMS implementation. It is on the roadmap. We will post a functional specification soon. Follow the development page and chip in when the tasks are listed.
                            http://jboss.org/developers/tasks.html

                            Best,

                            Ivelin