1 Reply Latest reply on Jun 17, 2010 4:18 AM by Jeff Mesnil

    Retrieving attributes for a JMS Queue - Did the call succeed or fail?

    Aspi Engineer Newbie

      How do you find out if a call to retrieve a attribute via the management API failed? For example, in the below sample code, the method "hasOperationSuceeded" always returns false.

       

      Message message = session.createMessage();
      JMSManagementHelper.putAttribute(message, "jms.queue.ExampleQueue", "messageCount");
      Message reply = requestor.request(message);
      Object o = JMSManagementHelper.getResult(reply);
      if (JMSManagementHelper.hasOperationSucceeded(reply)) {
          log.info("There are " + o.toString() + " messages in queue [" + "jms.queue.ExampleQueue" + "]");   
      } else {
          log.error("Failed: Management response is [" + o.toString() + "]");
      }

       

      On a side note, should one be using the management API, or should one be using the JMX API to do these kinds of activities?

       

      Thanks

      Aspi Engineer