3 Replies Latest reply on Sep 13, 2002 4:50 AM by Peter Antman

    How to make two different JMS connections using the same use

    Jeelani Shaik Newbie

      Hi,

      When I try to make two connections to a durable topic on JMS using the same user credentials, I am getting exception saying client-Id is already bound,

      Can some one explain on how to make 'n' no. of connections using the same user credentials?

        • 1. Re: How to make two different JMS connections using the same
          Joel Vogt Master

          I believe if you use different client id's under same user pass you should be okay

          • 2. Re: How to make two different JMS connections using the same
            Jeelani Shaik Newbie

            Hi Thanks for the reply.
            Actually what I want to do is the following:

            there r two topics Topic-1, Topic-2. and now there a subscriber java class which creates a connection and start listening to a the given topic. but I want to make two connections one to each topic using the same username credentials concurrently.

            Since the subscribers are durable, I want to attach different client ids to the same user as shown below:




            admin
            admin
            ID-1
            ID-2



            admin





            ID-1
            Topic-1
            Topic-1


            ID-2
            Topic-2
            Topic-2




            But when I tried to run the program, the following exception occured:

            JMS Context Initialization Exception :org.jboss.mq.SpyJMSException: Cannot get a
            client ID; - nested throwable: (javax.jms.JMSSecurityException: The login id ha
            s an assigned client id. That client id is already connected to the server!)
            Exception :java.lang.NullPointerException
            --------------------------

            I am not sure on whether we can add two IDs under the tag.

            I bought the JBOSS documentation provided by jboss.org. but it's like explaining concepts with helloworld program.

            Any help is welcome. Thanks for the same.
            Jeelani

            • 3. Re: How to make two different JMS connections using the same
              Peter Antman Expert

              There is now way you can do it like that. If you want the same user to be logged in more than once you can not connect a clientid to the user by configuration. You have to set a different clientid for each userlogin programaticallt through the JMS API, i. e after the connection is established, but before you do anything else.

              As with most stuff in JBoss, look into the testsuites if you need axamples. jboss-all/testsuite/src/main/org/jboss/test/jbossmq/test/SecurityUnitTestCase.java has a lot of tests of auth and durable subs.