6 Replies Latest reply on Mar 19, 2002 5:25 PM by Jay Wright

    Dynamic queue creation and deletion

    Mark Volmer Newbie

      Dynamic queue creation and deletion

      Hello JBossMQ, I have the following problem:
      1. Created new queue with name "foo" (using QueueManager MBean).
      2. Deleted this queue.
      3. Created the queue "foo" again.
      In this stage JBoss throws exception saying that the
      queue already exists (see the attached file with JBoss log screen).
      Is it known bug or may be I don't use the MBean service correctly?
      Where can I download the updated release of the JBossMQ?

      My environment: JDK1.4.0, JBoss 2.4.4, Win2000.
      P.S.: may be it is a JDK1.4 problem?

      Thank you in advance.

        • 1. Re: Dynamic queue creation and deletion
          Mark Volmer Newbie

          By now I've found the hack that solves the problem,
          but its probably not the best solution here.

          MBeanServer server = (MBeanServer)

          JMSServer jmsServer = (JMSServer) server.invoke(
          new ObjectName("JBossMQ",
          new Object[]{},
          new String[]{});

          jmsServer.deleteTemporaryDestination( null,
          new SpyQueue(queueName) );

          The main problem is that I have to explicitly use JBoss classes - my code becomes application server dependent.
          May be you know some other solution to the problem?
          May be there is a patch to the bug?

          • 2. Re: Dynamic queue creation and deletion
            Adrian Brock Master

            Have a look at the spec, section 5.2

            I don't think you would appreciate the comment
            "Since most clients use statically defined queues, this is not a problem"
            On your specific code,
            don't use invoke() to get an MBean's attribute, in
            your case "JMSServer".
            It only works because of a bug in Sun's MBeanServer,
            which is likely to plugged very soon.

            You should use server.getAttribute() instead.
            I've already fixed this problem in JBossMQ source for 3.0


            • 3. Re: Dynamic queue creation and deletion
              Mark Volmer Newbie

              Thank you for the tip about the bug.
              Changed the code to getAttribute() method - works fine.

              About the JBossMQ 3.0 - is there some way to "plug" it into
              JBoss 2.4.4 version?
              Is JBossMQ 3.0 a stable package or under massive development?

              Sometimes I get errors about OIL Client connection already closed -
              its look like some race condition but I don't have a clue how to
              solve it. May be you can point me to some direction.

              Thank you in advance, Mark.

              • 4. Re: Dynamic queue creation and deletion
                Adrian Brock Master


                I don't really do much work on JBossMQ.

                I know JAAS security was recently added and of course
                there's clustering in 3.0

                You might want to report your problem as a bug.
                If it's fixed in 3.0, it might be possible to apply the
                fix to 2.4.5, the next maintenance release for the
                2.4 branch.


                • 5. Re: Dynamic queue creation and deletion
                  Peter Antman Expert

                  Not to long a goo (one week) I announced the availability of a compat package - a backpatch of 3.0 to 2.4 that I wanted people to test - but no onehas shown any interest in it.


                  • 6. Re: Dynamic queue creation and deletion
                    Jay Wright Newbie

                    Where is everyone accessing the org.jboss.mq.pm classes from? I'm using jboss2.4.4 and I do not have access to these classes. I am trying to turn off persisted queueing for at least one of my message queues.

                    Is there a place to get this source code?