When you work with the MQSeries-related EGL keywords like add and scan, you define an MQ record for each message queue you wish to access. The record layout is the format of the message.
The next table lists the keywords.
Keyword | Purpose |
---|---|
add | Places the content of an MQ record at the end of the specified
queue.
The EGL add statement invokes as many as three MQSeries commands:
After adding an MQ record, you must close a message queue before reading an MQ record from the same queue. |
close | Relinquishes access to the message queue that is associated with an MQ
record.
The EGL close statement invokes the MQSeries MQCLOSE command, which also is invoked automatically when your program ends. You should close the message queue after an add or scan if another program requires access to the queue. The close is particularly appropriate if your program runs for a long time and no longer needs access. |
scan | Reads the first message in a queue into a message queue record and (by
default) removes the message from the queue.
The EGL scan statement invokes as many as three MQSeries commands:
After reading an MQ record, you must close the queue before adding an MQ record to the same queue. |
When you work with the MQSeries-related EGL keywords, you identify a queue in the following situations:
The name of the physical queue has the following format:
queueManagerName:physicalQueueName
The first time that you issue an add or scan statement against a message queue record, a connecting queue manager must be specified, whether by default or otherwise. In the simplest case, you do not specify a connecting queue manager at all, but rely on a default value in the MQSeries configuration.
The record-specific variable record.resourceAssociation always contains at least the name of the message queue for a given MQ record.
If you want to access a queue that is controlled by a remote queue manager, you must do the following:
You set record.resourceAssociation in one of two ways, depending on how the queue-manager relationships are established in MQSeries:
Your next use of the add or scan statement issues an MQOPEN to establish access to the remote queue.
Related concepts
Direct MQSeries calls
MQSeries support
Related reference
MQ record properties
Options records for MQ records
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.