ReadMessageQueue

Use the ReadMessageQueue activity to read a message from the message queue on an IBM i system. The queue read can be any queue to which the user ID used has access. The activity can return any number of messages depending on how it is configured.

General

The General tab contains the following fields:

Field Process Property? Module Property? Description
Name No No The name to be displayed as the label for the activity in the process.
IBM i Connection No Yes Click to select an IBM i shared resource.

If no matching IBM i shared resources are found, click Create Shared Resource to create one. See Creating an IBM i Shared Resource for more details.

Message Queue Yes Yes The name of a message queue (*MSGQ) to read messages from. The format of the message queue name is library_name/message_queue_name.

Type the message queue name manually, or click to open the Fetch Object dialog. All libraries are listed in the dialog, you can expand each library to view a list of available message queues (*MSGQ).

Note: The plug-in supports the wildcard queries, you can also use the *LIBL/message_queue_name format to specify a message queue.
Number of Messages Yes Yes Indicates the maximum number of messages that the activity should read when looking for messages that match the JobID. If the JobID is not provided, then all messages read are returned.
Offset From Top of Queue Yes Yes Start the read from this zero based offset from the top of the queue.
MessagesNeedReply No No Filter to include messages that need a reply.
MessagesNoNeedReply No No Filter to include messages that do not need a reply.
SendersCpyMsgsNeedReply No No Filter to include messages which are sender copies and need a reply.
Read and Delete No No Delete the messages as they are read.

Description

A short description of the ReadMessageQueue activity.

Input

The following is the input for the ReadMessageQueue activity:

Input Item Data Type Description
JobID String The ID of a job. Each unit of work that is processed by the IBM i system is called a job. A job is uniquely identified by a job ID assigned by the system when the job is started. If no JobID is provided, then all messages are returned.
MessageQueue String The name of a message queue (*MSGQ) from where messages are read by the activity. The format of the message queue name is:

library_name/message_queue_name

Note: If you enter nothing in this item, the ReadMessageQueue activity reads the message from the message queue you specified in the Message Queue field in the General tab. If you enter a message queue name which is different from the message queue you specified in the Message Queue field in the General tab, the activity reads the message from the message queue in the Input tab.

Output

The following is the output for the ReadMessageQueue activity:

Output Item Data Type Description
Success Boolean A value of true indicates the operation succeeded.

A value of false indicates the operation failed.

If the operation succeeds, the following elements under the Results node are filled in:
MessageID String The ID of the system message.
JobID String The job identifier of the message.
Message String The system message.

Fault

The Fault tab lists exceptions that are thrown by the ReadMessageQueue activity:

Fault Thrown When...
IBMiPluginException The plug-in fails to get a status response due to a plug-in error.
ActivityTimedOutException The plug-in fails to get a status response due to a timeout error.
IBMiParameterConvertException The plug-in fails to convert the schema parameters.
IBMiRemoteException The plug-in fails to communicate with an IBM i system.