Sending and Receiving Long Messages

Activities that support logical messages have a Multi-Message tab on which the sending and receiving of logical messages can be configured.

When getting a message from a queue which has or might have logical messages, it is important to configure these options to prevent the inadvertent removal of a member of a group, the following figure shows the Multi-Message tab in the Put activity.

Message Groups

Both the put and get operations support message groups.

  • The put operation, there are three ways to send a multiple message group through the plug-in:
    • The Batch option does not create a group. If you click Batch, you can send all the messages configured through the input schema in a single logical unit of work. Each node in the input schema is composed into a message and is sent within the bounds of a syncpoint. When the nodes are sent successfully, a commit is performed. If this is done within the context of an MQ Local Transaction, the commit is deferred until the transaction scope ends.

    • The BatchGroup option sends all the messages represented by the input schema as members of a single logical message. Commit boundaries are the same as for a Batch group.
    • You can use the CustomGroup option to use a sequence of put operations to create a logical group. You can turn on the last message flag in the input schema for the last message or make the group fail. You can also use a loop to create the logical message. If the individual Custom Group operations are not in a local transaction, they are committed at the end of the activity which means that any application listening for these message might begin to process them immediately. If it is a requirement that no application accesses these messages until the group is completed, place the creating loop inside a local transaction.
  • The get operation supports the Batch and BatchGroup operations. In the Batch mode, messages are retrieved until the specified size of the batch is reached and then returned to the activity as individual nodes on the output Batch schema. This is done as a single unit of work and is committed when the activity completes unless it is inside an MQ Local Transaction. The BatchGroup mode fetches the contents of an entire logical message and returns it as a batch. The commit semantics are the same as for Batch gets.

    Note: If the None option is selected, an a logical message is encountered and the first member of the logical message is fetched and returned from the activity. This breaks the logical message structure, so take note when accessing queues, which contain logical messages. The Complete Message and Get Ordered flags can be turned off to access the members of broken groups.

For get and put operations, the Multi-Message tab contains the Syncpoint Used check box, which is not a configuration option, but an indication of whether the operation requires the use of a syncpoint. Syncpoints impose a significant overhead on queue operations, so avoid using them wherever possible for performance reasons. However, for groups of messages, it is efficient to process the group within a single sync-point.

Logical messages can also be created and consumed in loops by using the Get and Put activities configured with the CustomGroup option which is in the Multi-Message tab. Working with large messages in loops makes it possible to process very large messages without necessarily consuming an equivalent amount of memory.

Segmented Messages

Both the Get and Put activities support segmented messages.

The Get activity creates segmented messages if messages are slices of a larger message. The segmented messages are always concatenated together to reconstitute the original message after the operation. Individual segments might not differ in terms of the message context or other fields on the input schema. The Get activity always returns a single reconstituted message when a segmented message is encountered.

The Put activity creates a segmented message if Explicit is selected in the Segmentation field and the message is larger than the size provided. The queue manager automatically creates segment messages if Queue Manager is selected in the Segmentation field. If Both is selected in the Segmentation field, it means both the Explicit and Queue Manager options are selected.

Segmented messages can also be created and consumed in loops by using get and put activities configured with the CustomSegmented option which is in the Multi-Message tab. Working with large messages in loops makes it possible to process very large messages without necessarily consuming an equivalent amount of memory.

Note: The segmented message feature is not supported by WebSphere MQ on z/OS.