FAQ for unsupported features in Open Message Queue Cannot resolve external resource into attachment.

If you are interested in contributing to this FAQ, please read the Contribution Guidelines.

Back to main Open MQ FAQ page
Back to Open MQ

Note: This web page lists various features of Open Message Queue that are not supported. Bugs filed against them will probably not be addressed. They are present in Open Message Queue for a number of reasons such as for debugging purposes, or for private use by another product. Use these APIs/features at your own risk.
Q: How do I list, query, delete or replace messages in a destination ?
A: You can either use a private Open Message Queue API and write your own application to do this or imqcmd. However, imqcmd cannot be used to replace messages in a destination. This API and the imqcmd enhancements can be used to inspect messages in queue or topic destinations.
A quick description of these operations:

  • list - list messages in a destination
  • query - query (i.e. obtain more detail) on a specific message in a destination
  • delete - delete a specific message in a destination
  • replace - replace a specific message in a destination with one you create. The old/new messages have to match types. Basically this is:
    • delete old/existing message
    • replace it with the new message you create
      Open Message Queue API for listing/querying/deleting/replacing messages
      You need to download the following items:
  • zip file containing ant project: Mqmsgadmin.zip. The README file included in this zip file will describe how to run the sample applications in the ant project.
  • (Optional) zip file containing HTML pages that describe the JMS based protocol between the Open Message Queue broker and administrative clients (imqcmd, imqadmin). This zip file is named adminprotocol.zip and is located under the File Archives section of the Open Message Queue website in the architecture/adminprotocol folder. Some of the files in Mqmsgadmin.zip refer to HTML files which are in this adminprotocol.zip file. At the time this document was written, a adminprotocol.zip file for Open Message Queue 4.2 was added to the website - the information relevant to message manipulation there should be compatible with Open Message Queue 4.1 as well.
    imqcmd
    The following commands can be used to quickly examine messages (eg what type they are or what properties they have) in a destination:
    Listing messages
    List all messages in queue 'TestQueue':
    % imqcmd list msg -t q -n TestQueue -nocheck
    Listing messages for the destination
    ------------------------------------
    Destination Name    Destination Type
    ------------------------------------
    TestQueue           Queue
    
    On the broker specified by:
    
    -------------------------
    Host         Primary Port
    -------------------------
    localhost    7676
    
    --------------------------------------------------------------------------------------------------
    Message #   Message IDs                                                     Priority   Body Type
    --------------------------------------------------------------------------------------------------
    0           ID:9-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169630     4          TextMessage
    1           ID:10-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169709    4          TextMessage
    2           ID:11-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169717    4          TextMessage
    3           ID:12-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169720    4          TextMessage
    4           ID:13-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169723    4          TextMessage
    5           ID:14-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169727    4          TextMessage
    6           ID:15-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169731    4          TextMessage
    7           ID:16-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169808    4          TextMessage
    8           ID:17-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169812    4          TextMessage
    ...

List all messages in queue 'TestQueue' starting at index 90 (Note - indices start at 0):

% imqcmd list msg -t q -n TestQueue -startMsgIndex 90 -nocheck
Listing messages for the destination
------------------------------------
Destination Name    Destination Type
------------------------------------
TestQueue           Queue

On the broker specified by:

-------------------------
Host         Primary Port
-------------------------
localhost    7676

--------------------------------------------------------------------------------------------------
Message #   Message IDs                                                     Priority   Body Type
--------------------------------------------------------------------------------------------------
90          ID:99-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457170112    4          TextMessage
91          ID:100-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457170115   4          TextMessage
92          ID:101-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457170118   4          TextMessage
93          ID:102-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457170124   4          TextMessage
94          ID:103-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457170128   4          TextMessage
95          ID:104-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457170131   4          TextMessage
96          ID:105-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457170134   4          TextMessage
97          ID:106-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457170138   4          TextMessage
98          ID:107-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457170141   4          TextMessage
99          ID:108-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457170144   4          TextMessage

List 10 messages in queue 'TestQueue' starting at index 15:

% imqcmd list msg -t q -n TestQueue -startMsgIndex 15 -maxMsgsRet 10 -nocheck
Listing messages for the destination
------------------------------------
Destination Name    Destination Type
------------------------------------
TestQueue           Queue

On the broker specified by:

-------------------------
Host         Primary Port
-------------------------
localhost    7676

-------------------------------------------------------------------------------------------------
Message #   Message IDs                                                    Priority   Body Type
-------------------------------------------------------------------------------------------------
15          ID:24-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169837   4          TextMessage
16          ID:25-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169840   4          TextMessage
17          ID:26-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169844   4          TextMessage
18          ID:27-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169846   4          TextMessage
19          ID:28-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169849   4          TextMessage
20          ID:29-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169854   4          TextMessage
21          ID:30-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169857   4          TextMessage
22          ID:31-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169860   4          TextMessage
23          ID:32-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169872   4          TextMessage
24          ID:33-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169875   4          TextMessage

Successfully listed messages.

Querying a message
Query a message in queue 'TestQueue' (Note - the message ID is placed in quotes to prevent any potential problems with the command shell):

% imqcmd query msg -t q -n TestQueue -msgID "ID:24-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169837" -nocheck
Querying message:
------------------------------------------------------------
Message ID
------------------------------------------------------------
ID:24-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169837

In the destination
------------------------------------
Destination Name    Destination Type
------------------------------------
TestQueue           Queue

On the broker specified by:

-------------------------
Host         Primary Port
-------------------------
localhost    7676

--------------------------
Message Header Information
--------------------------
Message ID                  ID:24-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169837
Correlation ID              TestCorrID
Destination Name            TestQueue
Destination Type            Queue
Delivery Mode               PERSISTENT (2)
Priority                    4
Redelivered                 false
Timestamp                   7/30/08 3:32:49 PM
Type
Expiration                  12/31/69 4:00:00 PM
ReplyTo Destination Name    temporary_destination://queue/AAA.BBB.CCC.DDD/58798/1
ReplyTo Destination Type

------------------------------
Message Properties Information
------------------------------
LongProp      6534
IntProp       3
StringProp    TestStringValue
DoubleProp    7.4687643E7

------------------------
Message Body Information
------------------------
Body Type    TextMessage (1)

Deleting a message
Delete a message in queue 'TestQueue' (Note - the message ID is placed in quotes to prevent any potential problems with the command shell):

imqcmd destroy msg -t q -n TestQueue -msgID "ID:24-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169837" -nocheck
Destroying message:
------------------------------------------------------------
Message ID
------------------------------------------------------------
ID:24-AAA.BBB.CCC.DDD(e9:3b:c8:51:8b:75)-58798-1217457169837

In the destination
------------------------------------
Destination Name    Destination Type
------------------------------------
TestQueue           Queue

On the broker specified by:

-------------------------
Host         Primary Port
-------------------------
localhost    7676

Are you sure you want to destroy this message? (y/n)[n] y

Successfully destroyed message.