Java CAPS JMS Reference

Message Examples


Example 1–15 Changing Message Contents in a Topic

The following command changes the contents of a message on topic T0.


stcmsctrlutil -ctm T0 182 -p 18007 -msgtype text 
NEWCONTENTS^Z

Response:


Message: 182 has been changed

The following command displays the revised contents of the message.


stcmsctrlutil.exe -p 18007 -tmessage T0 182 -msgtype text

Response:


NEWCONTENTS


Example 1–16 Displaying Active Message Properties

This example requests information about a specific message in queue Q0 with sequence number 0.

Command:


stcmsctrlutil -qml Q0 0 1

Response:


Number Of Messages(s): 0

In this example, the message has been consumed. As a result, the information is no longer available from the JMS IQ Manager. You must obtain the information from a journal or an archive.



Example 1–17 Displaying Journaled Message Properties

This example requests information about a specific message in queue Q0 with sequence number 0 from the journaler. As long as the journal has not expired, the message properties are available for viewing.

Command:


stcmsctrlutil -j -qml Q0 0 1

Response:


Number Of Messages(s): 1
Message[1]:
Message.SeqNo=0
Message.Timestamp=1031789647260
Journaler.ExpirationTime=1031809647260
Message.Size=228
Message.JMSProperty.TS=1031789647260
Message.JMSProperty.EX=0
Message.JMSProperty.DM=1
Message.JMSProperty.TY=ASCII
Message.JMSProperty.PR=0
Message.JMSProperty.RD=false
Message.JMSProperty.MI=ID:377:3b742aa5:950:0a01beee:3d7fdc4f104
Message.UserProperty.JMS_ProducerID=BENCH


Example 1–18 Displaying Archived Message Properties

This example displays a description of the message with sequence number 1, in topic T0, in the archive file that has been extracted to the specified directory.

Command:


stcmsctrlutil -ar archive-file-extract-directory -tml T0 1 1

Response:


Number Of Messages(s): 1
Message[1]:
Message.SeqNo=1
Message.Timestamp=1031789654330
Journaler.ExpirationTime=1031809654330
Message.Size=228
Message.JMSProperty.EX=0
Message.JMSProperty.TS=1031789654330
Message.JMSProperty.DM=1
Message.JMSProperty.TY=ASCII
Message.JMSProperty.PR=0
Message.JMSProperty.MI=ID:45c:3b742aa6:950:0a01beee:3d7fdc5614a
Message.JMSProperty.RD=false
Message.UserProperty.JMS_ProducerID=BENCH


Example 1–19 Republishing Journaled Messages from Topics

This example republishes five journaled messages from topic T0 starting from message with sequence number 491.

Command:


stcmsctrlutil -j -tmi T0 491 5

Response:


Executed function: IMPORT
Importing messages
Last imported sequence number = 491
Last imported sequence number = 497


Example 1–20 Republishing Journaled Messages from Queues

This example republishes five journaled messages from queue T0 starting from message with sequence number 500.

Command:


stcmsctrlutil -j -qmi T0 500 5

Response:


Executed function: IMPORT
Importing messages
Last imported sequence number = 500
Import failed
Import failed on sequence number: 500


Note –

This example failed, because no messages exist past sequence number 500.