Hi! thanks for the reply.
This is my real config. I have the following queue (one local, one remote), at this point everything is set up correctly.
So far I have not understood an important point, about the initiation queue.
I must create the queue called "SYSTEM.CHANNEL.INITQ" inside the IBM MQ? because I think it is not created.
In case I need to create the startup queue "SYSTEM.CHANNEL.INIT", what configuration should I have?
Apologies for so many questions I am a new user and need to solve certain technical issues.
Original Message:
Sent: Wed January 25, 2023 11:00 PM
From: Morag Hughson
Subject: Queue and Channel Automatic transmission
Hi Emanuel,
Sorry to hear that you are having trouble getting your channel to automatically start when messages are put to the transmission queue. What follows is a worked example for automatically starting a channel by using the MQ feature called "triggering" on the transmission queue. It uses two queue managers. Here is a picture of what will be defined.
On your Sending queue manager, called QM1 in my picture, you will define the following objects:-
- Sender Channel
- Transmission Queue (a QLOCAL object)
- Remote queue (a QREMOTE object)
- The Initiation queue called SYSTEM.CHANNEL.INIT queue which you need will already be defined on your queue manager
On your Receiving queue manager, called QM2 in my picture, you will define the following objects:-
- Receiver Channel
- Target Queue (a QLOCAL object)
It is assumed that you already have a listener set up on QM2 since your question was about triggering not about channel connectivity. Let me know if you need help with the listener side of things too.
For each object in this worked example, I will show you the MQSC command to define the object and also describe the attributes to set in case you are not able to use MQSC commands (your question showed a screen shot from a GUI tool so I am uncertain if you are able to use MQSC).
- Sender Channel
MQSC command:
DEFINE CHANNEL(QM1.QM2) CHLTYPE(SDR) TRPTYPE(TCP) XMITQ(QM2) CONNAME('machine2-addr(port-number)') DISCINT(300)
Attributes:
Channel Name: QM1.QM2
Channel Type: Sender
Transport Type: TCP/IP
Transmission Queue Name: QM2
Connection Name: this is the IP address or DNS host name of the machine where QM2 lives with the port number of the QM2 listener in round brackets on the end.
Disconnect Interval: 300 - this is in seconds - after this time period has passed where the sender channel has had nothing to do, it will end normally and leave itself in a state ready to be trigger started again later - that is, it will be in Inactive status. - Transmission Queue
MQSC command:
DEFINE QLOCAL(QM2) USAGE(XMITQ) TRIGGER TRIGTYPE(FIRST) TRIGDATA(QM1.QM2) INITQ(SYSTEM.CHANNEL.INITQ)
Attributes:
Queue Name: QM2 (It is a good practice to name the transmission queue the same as the queue manager it is targeting).
Usage: Transmission Queue
Trigger Control: On
Trigger Type: First
Trigger Data: The name of the sender channel, from step 1, to be started when a message arrives on this transmission queue
Initiation Queue: SYSTEM.CHANNEL.INIT - this is the initiation queue used by the Channel Initiator, which is what starts the channel for you. - Remote Queue
MQSC command:
DEFINE QREMOTE(SEND.TO.QM2) RNAME(TARGET.QUEUE) RQMNAME(QM2) XMITQ(QM2)
Attributes:
Queue Name: This is the name of the queue that your application will use - in my example I have called it SEND.TO.QM2
Remote Queue Name: This is the name of the queue on the receiving queue manager, which you will define in step 6, in my case I have called it TARGET.QUEUE
Remote QMgr Name: QM2
Transmission Queue Name: QM2 - this is the name of the transmission queue in step 2. - Initiation Queue
The SYSTEM.CHANNEL.INITQ will already be defined on your queue manager. - Receiver Channel - on QM2
MQSC command:
DEFINE CHANNEL(QM1.QM) CHLTYPE(RCVR) TRPTYPE(TCP)
Attributes:
Channel Name: QM1.QM2 - this must match the name of the sender channel you defined in step 1 on your sending queue manager.
Channel Type: Receiver
Transport Type: TCP/IP - Target Queue - on QM2
MQSC command:
DEFINE QLOCAL(TARGET.QUEUE)
Attributes:
Queue Name: This name must match what you specified in the Remote Queue Name of the queue you defined in Step 3 on your sending queue manager.
Remember, as mentioned before, if you already have messages on your transmission queue before you make the configuration changes to enable triggering, you should start the channel manually first to allow it to clear all the messages, then when it next needs to be start, it can be started automatically when the depth of the queue changes from 0 to 1.
Let me know if any of the above is not clear - happy to explain anything you need in more details.
Cheers,
Morag
------------------------------
Morag Hughson
MQ Technical Education Specialist
MQGem Software Limited
Website: https://www.mqgem.com
Original Message:
Sent: Wed January 25, 2023 11:09 AM
From: Emanuel Gonzalez
Subject: Queue and Channel Automatic transmission
Hello! thanks for the reply.
Inside the ibm mq I created two queues, one local (name mq-local) and one remote (name mq-remote) , use in the field "Initiation queue:" the value SYSTEM.CHANNEL.INITQ see this error:
AMQ9544W: Messages not put to destination queue.
EXPLANATION:
During the processing of channel 'XXX.XXXX' one or more messages could
not be put to the destination queue and attempts were made to put them to a
dead-letter queue. The location of the queue is 1, where 1 is the local
dead-letter queue and 2 is the remote dead-letter queue.
ACTION:
Examine the contents of the dead-letter queue. Each message is contained in a
structure that describes why the message was put to the queue, and to where it
was originally addressed. Also look at previous error messages to see if the
attempt to put messages to a dead-letter queue failed. The program identifier
(PID) of the processing program was '1299443'.
I'm going to work with many queues of the local and remote type.
I don't understand how to configure this correctly so that messages are sent automatically and the channel is deactivated by inactivity.
The message must reach the local queue and then be sent to the remote queue.
I must create a call queue "SYSTEM.CHANNEL.INITQ" for all queue?
Regards,
------------------------------
Emanuel Gonzalez
Original Message:
Sent: Tue January 03, 2023 06:28 PM
From: Morag Hughson
Subject: Queue and Channel Automatic transmission
Hi Emanuel,
You are quite right that you can automatically start your sender channel when messages arrive on its transmission queue by using an MQ feature called "Triggering".
You need to make the following changes to your transmission queue:-
- Set Trigger Type to "First" - as you rightly said
- Set Trigger Control to "On"
- Set Initiation Queue to "SYSTEM.CHANNEL.INITQ
If you also want to make the channel go inactive when it has nothing more to do, you should look for the "Disconnect Interval" setting on the channel.
It is a best practice to combine triggering to activate the channel and the Disconnect Interval to deactivate the channel.
Also, please be aware that since you have messages already on the transmission queue, and you do not yet have triggering configured on the transmission queue, you might be best to use the manual START CHANNEL command to get it going this first time as triggering would be looking for the change from a queue depth of 0 to a queue depth of 1
Please don't hesitate to ask follow up questions if I have not explained it well enough, or if there are words that you don't understand. I am happy to try to describe it using different words until you understand.
Cheers,
Morag
------------------------------
Morag Hughson
MQ Technical Education Specialist
MQGem Software Limited
Website: https://www.mqgem.com
Original Message:
Sent: Tue January 03, 2023 02:47 PM
From: Emanuel Gonzalez
Subject: Queue and Channel Automatic transmission
Hi all, I have read the documentation but as I am learning English there are some terms I cannot understand.
I created two queues (local and remote and a channel).
I'm seeing the channel is deactivated and messages are stuck in the local queue.
In the documentation it indicates that I must configure the triggers to activate the send in case of entering an email in the queue.
This is my configuration:
Using the trigger type "first" when the queue has a message sends it, am I correct?
I need to deactivate the channel when it is inactive but activate it to the channel when a message reaches the queue.
Any helps??
------------------------------
Emanuel Gonzalez
------------------------------