5.15.5 RECEIVE

The RECEIVE command is used to receive a message and optionally save the contents to a file.

To receive JMS message properties from the message, use the optional working list argument.

The first column receives the property type, the second column receives the property name and the third column receives the property value. The property type is always S (String) for user-defined properties and J for special JMS properties.

If the received message is a TextMessage then the encoding value is used to covert the Unicode content into a byte content to be saved to the specified file.

The message identifier (MessageID) is returned in the JSMMSG field.

Syntax:

Command

Keyword

Value

Developer notes

RECEIVE

FILE

value

Optional. File path.

ENCODING

value

Conditional. Used if received message is a Unicode TextMessage.
Default is UTF-8.

WAITTIME

value.

Optional. Wait time in milliseconds.
Default is 0 forever.

SELECTOR

value

Optional. Message Selector.

ARCHIVE

value

Optional. Archive file.

 

Example

RECEIVE ENCODING(UTF-8) FILE(/folder/file.xml) #WRKLST(PRPTYP,PRPNME,PRPVAL)