2 Replies Latest reply on Aug 30, 2010 2:43 AM by hughbragg

    Howto determine if a JMS queue exists before using it

    hughbragg

      Is there a way to quickly determine if a JMS queue exists before attempting to send/receive on it?

       

      I have a program which follows the examples, but they all create a queue in ste 1 before connecting:

      Queue queue = HornetQJMSClient.createQueue(cfg.JMS_QUEUE);

       

      If I do this then I follow the rest of the example create a session, connect, start everything runs smoothly.

       

      If I missname the queue on the server the client doesn't complain until it tries to send or receive a message.

      That's a problem as I have a socket open which is expecting a response and the exception causes it to hang.

       

      I can rewrite the socket to catch the exception, but I'd be much happier if I could determine if the queue exists when I startup. That way I can issue a warning when something isn't right.