Defining resource associations for message queues
You can define resource associations to specify default values for EGL programs that access message queues.
- Define the queue manager name and queue name
- Define the system
- Convert message formats
- Open an EGL build file by right-clicking the file name in the Project Explorer and selecting .
- Create a resource association part by right-clicking the build file in the Outline view and selecting Add Part.... Select Resource Association from the wizard dialog and click Next.
- Specify a name for the Resource Association part and an optional free-form description. Click Finish.
- EGL displays the Resource Association part. Click Add Association to add a new element. Specify a file name (fileName property) to identify the element. The entry will apply to any message queue record whose fileName property matches the name you enter here.
- Enter a file type (fileType property) of WebSphere® MQ for the element.
- Specify the platform on which the message queue is located (system property).
- If you want to specify different properties for different systems, click Add System and specify additional systems.
-
- For each file name and system on the left side of the editor, you can specify properties
on the right side. The system and file type carry over from the left side. Specify the system
resource name (systemName property) in the following
form:
[queueManagerName:]queueNameSpecify only the queueName if you want to use the default queue manager. The system resource name for message queue records defines the queue manager name and queue name. The system resource name is used as the initial value for the fileName property for the MQRecord and identifies the default queue associated with the record.
EGL uses the system resource name in add and get next statements for the message queue record. The queueName identifies the queue that is accessed by the operation. The queueManagerName identifies the queue manager on which the queue is defined. The default queue manager is the queue manager to which the program is connected. If there is not already an active connection, EGL uses the queue manager name to connect to the queue manager before accessing the queue. If no queue manager name is specified, EGL connects to the default queue manager for the system. If the system resource name is not specified in a resource association file, a default system resource name is defined by the fileName property of the message queue record.
- In the case of Topic, for each file name and system on the left side of the editor, you
can specify properties on the right side. The system and file type carry over from the left
side. Specify the system resource name (systemName property) in the following
forms:
-
queueManagerName:queueName:topicString: -
queueManagerName::topicString: -
queueManagerName:queueName::topicName -
queueManagerName:::topicName -
queueManagerName
For subscription to a topic, the subscriptionName can be given either in property or in resource association subscriptionName field. For more details on subscription to a topic, refer to Writing subscriber applications
-
- For each file name and system on the left side of the editor, you can specify properties
on the right side. The system and file type carry over from the left side. Specify the system
resource name (systemName property) in the following
form:
- You can optionally specify a conversion table if you want data format conversion to be performed on the message. If you specify a conversion table, EGL converts the message from local format to remote format when the message is added or published to the queue or topic, and from remote format to local format when the message is read from the queue or topic. EGL performs conversion using the message queue or topic record structure to identify the data type of fields in the message.
- Specify which MQ provider you wish to access using the provider property. You can
choose IBMMQ, IBMMQJMS, RABBITMQ or ACTIVEMQ.
- IBMMQ – connect to IBM MQ using AMQP. Supports Message Queues but not Topics. This is the default, and supports existing EGL MQ applications including IBM MQ options records.
- IBMMQJMS - connect to IBM MQ using JMS. Supports Message Queues and Topics, but does not support IBM MQ options records.
- RABBITMQ - connect to RabbitMQ using AMQP. Supports Message Queues and Topics.
- ACTIVEMQJMS - connect to Apache ActiveMQ using JMS. Supports Message Queues and Topics.
-
Specify the hostof the MQ server and the portnumber to connect to, using the host and port properties.
- If connecting to IBM MQ, specify the connection channel using the channel property.
-
If connecting to RabbitMQ, specify the name of the mq exchange for handling messages using the exchangeName property. If this value is not specified, the topicName property in the MQ record will be used as the exchangeName.
-
If connecting to RabbitMQ, specify the type of the mq exchange for handling messages using the exchangeType property. Valid values are DIRECT, FANOUT, and TOPIC. Default value is DIRECT if the isTopicRecord property in the MQ record is set to NO. Otherwise, the default value is TOPIC.