MQ

 View Only
  • 1.  Queue and Channel Automatic transmission

    Posted Tue January 03, 2023 03:19 PM
    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
    ------------------------------


  • 2.  RE: Queue and Channel Automatic transmission

    IBM Champion
    Posted Tue January 03, 2023 06:29 PM
    Edited by Morag Hughson Tue January 03, 2023 08:49 PM

    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
    ------------------------------



  • 3.  RE: Queue and Channel Automatic transmission

    Posted Wed January 25, 2023 01:33 PM
    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
    ------------------------------



  • 4.  RE: Queue and Channel Automatic transmission

    IBM Champion
    Posted Wed January 25, 2023 11:00 PM
    Edited by Morag Hughson Fri February 03, 2023 03:31 AM

    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:-

    1. Sender Channel
    2. Transmission Queue (a QLOCAL object)
    3. Remote queue (a QREMOTE object)
    4. The Initiation queue called SYSTEM.CHANNEL.INITQ 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:-

    1. Receiver Channel
    2. 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).

    1. 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.
    2. 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.INITQ - this is the initiation queue used by the Channel Initiator, which is what starts the channel for you.
    3. 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.
    4. Initiation Queue
      The SYSTEM.CHANNEL.INITQ will already be defined on your queue manager.
    5. 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
    6. 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
    ------------------------------



  • 5.  RE: Queue and Channel Automatic transmission

    Posted Thu February 02, 2023 09:34 AM
    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.



    ------------------------------
    Emanuel Gonzalez
    ------------------------------



  • 6.  RE: Queue and Channel Automatic transmission

    IBM Champion
    Posted Fri February 03, 2023 03:31 AM

    The SYSTEM.CHANNEL.INITQ is one of the objects that is created when a queue manager is created. If you don't see it, make sure you can see other SYSTEM.* queues. It *SHOULD* be there. Can you see any of the other 49 SYSTEM queues that are normally defined on a queue manager? It seems highly unlikely that someone has deleted it, or your Channel Initiator wouldn't run correctly and channel retry couldn't function. Please double check. Try issuing the following MQSC command:-

    DISPLAY QLOCAL(SYSTEM.CHANNEL.INITQ)

    Using MQSC does not hide objects like many GUIs do. Or find the setting in the GUI you are using to "Show SYSTEM objects".

    This one single Initiation queue, read by the channel initiator (runmqchi) can be used to trigger start many many channels. You can use the same name SYSTEM.CHANNEL.INITQ as the name in the INITQ field for many transmission queues. It is intended to be used as a shared resource.

    Cheers,
    Morag



    ------------------------------
    Morag Hughson
    MQ Technical Education Specialist
    MQGem Software Limited
    Website: https://www.mqgem.com
    ------------------------------



  • 7.  RE: Queue and Channel Automatic transmission

    Posted Fri February 03, 2023 09:02 AM
    Hello Morag, thanks for you replies.


    runmqsc KIUTBS
    5724-H72 (C) Copyright IBM Corp. 1994, 2020.
    Se est� iniciando MQSC para el gestor de colas KIUTBS.
    
    DISPLAY QLOCAL(SYSTEM.CHANNEL.INITQ)
    1 : DISPLAY QLOCAL(SYSTEM.CHANNEL.INITQ)
    AMQ8409I: Ver detalles de la cola.
    QUEUE(SYSTEM.CHANNEL.INITQ) TYPE(QLOCAL)
    ACCTQ(QMGR) ALTDATE(2022-01-26)
    ALTTIME(15.59.04) BOQNAME( )
    BOTHRESH(0) CLUSNL( )
    CLUSTER( ) CLCHNAME( )
    CLWLPRTY(0) CLWLRANK(0)
    CLWLUSEQ(QMGR) CRDATE(2022-01-26)
    CRTIME(15.59.04) CURDEPTH(0)
    CUSTOM( ) DEFBIND(OPEN)
    DEFPRTY(0) DEFPSIST(NO)
    DEFPRESP(SYNC) DEFREADA(NO)
    DEFSOPT(EXCL) DEFTYPE(PREDEFINED)
    DESCR(IBM MQ Channel Initiation Queue)
    DISTL(NO) GET(ENABLED)
    HARDENBO IMGRCOVQ(QMGR)
    INITQ( ) IPPROCS(1)
    MAXDEPTH(1000) MAXMSGL(2000)
    MONQ(QMGR) MSGDLVSQ(PRIORITY)
    NOTRIGGER NPMCLASS(NORMAL)
    OPPROCS(0) PROCESS( )
    PUT(ENABLED) PROPCTL(COMPAT)
    QDEPTHHI(80) QDEPTHLO(20)
    QDPHIEV(DISABLED) QDPLOEV(DISABLED)
    QDPMAXEV(ENABLED) QSVCIEV(NONE)
    QSVCINT(999999999) RETINTVL(999999999)
    SCOPE(QMGR) NOSHARE
    STATQ(QMGR) TRIGDATA( )
    TRIGDPTH(1) TRIGMPRI(0)
    TRIGTYPE(NONE) USAGE(NORMAL)
    ​


    You see all right?

    Should I set the local queue this way then?



    ------------------------------
    Emanuel Gonzalez
    ------------------------------



  • 8.  RE: Queue and Channel Automatic transmission

    IBM Champion
    Posted Fri February 03, 2023 02:13 PM

    Hi Emanuel,

    I am happy to see that you have found your SYSTEM.CHANNEL.INITQ

    Your triggering properties for your transmission queue PROS.TYPEB.OUT are almost correct. You should use "Trigger Type" with the value "First" and not use "Every". Channels are written to expect to be triggered with "First".

    Cheers,
    Morag



    ------------------------------
    Morag Hughson
    MQ Technical Education Specialist
    MQGem Software Limited
    Website: https://www.mqgem.com
    ------------------------------



  • 9.  RE: Queue and Channel Automatic transmission

    Posted Tue May 30, 2023 04:57 PM

    Hello @Morag Hughson here me again haha

    I'm having trouble with queues and inactive channels again.
     
    We had a problem and it was necessary to activate the inactive channel to get the messages out.
     
    Could you please help me?
    Here I send you the configuration.
     
    DISPLAY QLOCAL(SYSTEM.CHANNEL.INITQ)
         1 : DISPLAY QLOCAL(SYSTEM.CHANNEL.INITQ)
    AMQ8409I: Display Queue details.
       QUEUE(SYSTEM.CHANNEL.INITQ)             TYPE(QLOCAL)
       ACCTQ(QMGR)                             ALTDATE(2021-08-10)
       ALTTIME(13.35.52)                       BOQNAME( )
       BOTHRESH(0)                             CLUSNL( )
       CLUSTER( )                              CLCHNAME( )
       CLWLPRTY(0)                             CLWLRANK(0)
       CLWLUSEQ(QMGR)                          CRDATE(2021-08-10)
       CRTIME(13.35.52)                        CURDEPTH(0)
       CUSTOM( )                               DEFBIND(OPEN)
       DEFPRTY(0)                              DEFPSIST(NO)
       DEFPRESP(SYNC)                          DEFREADA(NO)
       DEFSOPT(EXCL)                           DEFTYPE(PREDEFINED)
       DESCR(IBM MQ Channel Initiation Queue)
       DISTL(NO)                               GET(ENABLED)
       HARDENBO                                IMGRCOVQ(QMGR)
       INITQ( )                                IPPROCS(1)
       MAXDEPTH(1000)                          MAXMSGL(2000)
       MONQ(QMGR)                              MSGDLVSQ(PRIORITY)
       NOTRIGGER                               NPMCLASS(NORMAL)
       OPPROCS(0)                              PROCESS( )
       PUT(ENABLED)                            PROPCTL(COMPAT)
       QDEPTHHI(80)                            QDEPTHLO(20)
       QDPHIEV(DISABLED)                       QDPLOEV(DISABLED)
       QDPMAXEV(ENABLED)                       QSVCIEV(NONE)
       QSVCINT(999999999)                      RETINTVL(999999999)
       SCOPE(QMGR)                             NOSHARE
       STATQ(QMGR)                             TRIGDATA( )
       TRIGDPTH(1)                             TRIGMPRI(0)
       TRIGTYPE(NONE)                          USAGE(NORMAL)

    I temporarily changed the parameter Disconnect interval: to zero so it won't be deactivated again.


    ------------------------------
    Emanuel Gonzalez
    ------------------------------