The MQe JMX interface is intended as an administrative resource to assist in the configuration and management of MQe resources via JMX. Messaging operations do not therefore fall into its brief and such messaging operations as are provided are intended only for test purposes. putMessage() and deleteMessage() operations are provided for permitted queue types. These messaging operations provide a very limited scope for testing a network's connectivity and configuration. As the messaging operations are minimal it is not possible to test the operation of a network using store or forward queues.
The putMessage() method takes a single java.lang.String parameter representing the text of a message body. The user can only provide this single String – no further customization of the test message can take place. This message is put to the queue represented by the MBean upon which the method is invoked.
The MBean representing the queue in question also has an attribute called Messages (to qualify this statement, only MBeans representing queues of a type on which browse is permitted have this attribute). This attribute is of type [Ljava.lang.String; and can be retrieved using getAttribute()or getAttributes(). Each item in the String array represents the text of the message body put to the queue using the putMessage() method. If messages are put to the queue in question by any means other than the JMX interface putMessage() method, the text body will not be readable by the JMX interface and the value returned for Messages will reflect this.
The index of a message body in the Messages array can be used to delete that message from the queue using the deleteMessage() method. The index is passed in as the only parameter to the deleteMessage() method.
Note that both the putMessage() and the deleteMessage() methods should only be invoked via the MBeanServer invoke() method. This is true for all operations listed in this section.