2 Replies Latest reply on May 23, 2012 9:24 AM by richard916

    use of createQueue

    richard916

      hi.

      I am using JMS management to manage hornetq as Management Example shows.Here is a problem,

      after I create a queue with

      JMSManagementHelper.putOperationInvocation(m, "jms.server", "createQueue", "dynamicQueue","");
      reply = requestor.request(m);

       

      boolean success = JMSManagementHelper.hasOperationSucceeded(reply);
      System.out.println("operation invocation has succeeded: " + success);

      It indeed creates a queue named "dynamicQueue" and through JConsole I can see it. like this

      捕获.JPG

      but when I send msgs to this queue,it shows an exception" javax.naming.NameNotFoundException: dynamicQueue not bound"

      I guess I cann't find this queue from JNDI, does JNDI look up for queues from hornetq-jms.xml ?  I notice that the new queue doesnot exist in this xml file.

      since in my project i use JNDI to look up for queues, how can i use new queues?

      anyone can help me ?

        • 1. Re: use of createQueue
          jmesnil

          Richard Williams wrote:

           

          hi.

          I am using JMS management to manage hornetq as Management Example shows.Here is a problem,

          after I create a queue with

          JMSManagementHelper.putOperationInvocation(m, "jms.server", "createQueue", "dynamicQueue","");

           

          Last parameter is to configure the JNDI bindings for the created queue. You passed an empty string. Pass the name of the JNDI binding and that'll work.

          • 2. Re: use of createQueue
            richard916

            thank you jeff, it works!