1 Reply Latest reply on Sep 30, 2003 4:04 PM by adrian.brock

    Deleting Temporary queues

    nbirch

      Hi,

      Using JBoss MQ in JBoss3.0.8 on Linux.

      Is it necessary to call .delete() on the Temporary Queue, or will it be 'deleted' when the receiver is closed?

      My calling sequence is:
      tempQueue = session.createTemporaryQueue();
      publisher = session.createSender(queue);
      subscriber = session.createReceiver(tempQueue);

      // do work...

      publisher.close();
      // A
      subscriber.close();
      // B
      session.close();

      Currently "tempQueue.delete();" is not called, so will this cause a leak?

      If I call tempQueue.delete(); at point A above there is an exception, presumably because the "subscriber" would clean up the temporary queue? If I call tempQueue.delete(); at point B above there are no complaints, but I'm not sure if its necessary.

      I can't find any sample code that shows .delete() being called.

      Any thought?

      Nbirch