2 Replies Latest reply on May 20, 2008 5:09 AM by fredazom fredazom

    queue deletion

    Nick Breau Newbie


      I am able to programatically create a queue using the code bellow. Can someone point out what I need to call on server.invoke to programatically delete a queue ?

      ObjectName dm = new ObjectName("jboss.messaging:service=ServerPeer");
      server.invoke(
      dm,
      "createQueue",
      new Object[] { queueName, queueName },
      new String[] { String.class.getName(), String.class.getName()}
      );

      thanks,
      Nick.

        • 1. Re: queue deletion
          Peter Johnson Master

          Call 'destroyQueue' passing the name of the queue. You can try it out using the jmx-console.

          • 2. Re: queue deletion
            fredazom fredazom Newbie

            Hi All,

            I'm using destroyQueue (jboss-messaging-1.4.0.SP3 in JBoss 4.2.2 GA) and receive true from the invoke method

            Object result1 = mBeanServer.invoke(serverObjectName, "destroyQueue",
            new Object[] {queueName},
            new String[] {"java.lang.String"});
            if(((Boolean)result1).booleanValue()){
            System.out.println("Queue " + queueName + " destroyed");
            }else{
            System.out.println("Queue " + queueName + " not destroyed");
            }

            but this queue remains in JBM_POSTOFFICE table. Is it normal?

            When I delete it manually from the table (delete from JBM_...) and I try to create a new queue with the same name it doesn't appear on the table... Any hints?

            à+

            Fredy