Search code examples
ibm-integration-bus

How to Send Message to Destination List in Message Broker..?


Greetings to all smart people around here !!

I am newbie to WebSphere Message Broker,I have Question like this..

Question

create a sample flow to receive the XML message from the queue and send it to the destination list..

I will send Output to Particular Queue Name through MQ-OUTPUT but How to send it to the destination list..?


Solution

  • You need to set the MQ Output Node into "Destination List" mode using the "Destination Mode" property in the Advanced Tab on the node.

    You can then set the local environment values OutputLocalEnvironment.Destination.MQ.DestinationData[X].queueName = <queueName>

    For example take a look at the function given in Infocenter topic http://www-01.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ac16862_.htm

     CREATE PROCEDURE addToMQDestinationList(IN LocalEnvironment REFERENCE, IN newQueue char) BEGIN
      /*******************************************************************************
      * A procedure that adds a queue name to the MQ destination list in the local environment.
      * This list is used by an MQOutput node that has its mode set to Destination list.
      *
      * IN LocalEnvironment: the LocalEnvironment to be modified. 
      * IN queue: the queue to be added to the list
      *
      *******************************************************************************/
    DECLARE I INTEGER CARDINALITY(LocalEnvironment.Destination.MQ.DestinationData[]);
            IF I = 0 THEN
                SET OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueName = newQueue;
            ELSE
                SET OutputLocalEnvironment.Destination.MQ.DestinationData[I+1].queueName = newQueue;
            END IF;
        END;