IBM Integration Bus, Version 9.0.0.8 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

Populating Destination in the local environment tree

Use the Destination subtree to set up the target destinations that are used by output nodes, the HTTPRequest node, the SOAPRequest node, the SOAPAsyncRequest node, and the RouteToLabel node. The following examples show how you can create and use an ESQL procedure to perform the task of setting up values for each of these uses.

Copy and use these procedures as shown, or you can modify or extend them to perform similar tasks.

If you are creating this ESQL code for a Compute node, you must configure the node by setting the Compute Mode property so that it has access to the local environment tree in the output message. You must select one of the three values LocalEnvironment, LocalEnvironment And Message, or All.

Adding a queue name for the MQOutput node with the Destination Mode property set to Destination List
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;
For full details of these elements, see Data types for elements in the MQ DestinationData subtree.
Changing the default URL for a SOAPRequest node or a SOAPAsyncRequest node request
CREATE PROCEDURE overrideDefaultSOAPRequestURL(IN LocalEnvironment REFERENCE, IN newUrl char) BEGIN
  /*******************************************************************************
  * A procedure that changes the URL to which the SOAPRequest node or 
  * SOAPAsyncRequest node sends the request.
  * 
  * IN LocalEnvironment: the LocalEnvironment to be modified. 
  * IN queue:  the URL to which to send the request.
  *
  *******************************************************************************/
SET OutputLocalEnvironment.Destination.SOAP.Request.Transport.HTTP.WebServiceURL = newUrl;
END;
Changing the default URL for an HTTPRequest node request
CREATE PROCEDURE overrideDefaultHTTPRequestURL(IN LocalEnvironment REFERENCE, IN newUrl char) BEGIN
  /*******************************************************************************
  * A procedure that changes the URL to which the HTTPRequest node sends the request.
  * 
  * IN LocalEnvironment: the LocalEnvironment to be modified. 
  * IN queue: the URL to which to send the request.
  *
  *******************************************************************************/
  SET OutputLocalEnvironment.Destination.HTTP.RequestURL = newUrl;
END;
Adding a label for the RouteToLabel node
CREATE PROCEDURE addToRouteToLabelList(IN LocalEnvironment REFERENCE, IN newLabel char) BEGIN
  /*******************************************************************************
  * A procedure that adds a label name to the RouteToLabel list in the local environment.
  * This list is used by a RoteToLabel node.
  *
  * IN LocalEnvironment: the LocalEnvironment to be modified. 
  * IN label:  the label to be added to the list
  *
  *******************************************************************************/
	IF LocalEnvironment.Destination.RouterList.DestinationData is null THEN
     SET OutputLocalEnvironment.Destination.RouterList.DestinationData."label" = newLabel;
  ELSE
     CREATE LASTCHILD OF LocalEnvironment.Destination.RouterList.DestinationData
     NAME 'label' VALUE newLabel; 
  END IF;
END;
Setting up JMS destination lists
You can configure a JMSOutput node to send to multiple JMS Queues, or to publish to multiple JMS Topics by using a destination list that is created in the local environment tree by a transformation node. The following example shows how to set up JMS destination lists in the local environment tree:
CREATE PROCEDURE CreateJMSDestinationList() BEGIN
  SET OutputLocalEnvironment.Destination.JMSDestinationList.DestinationData[1]  = 'jndi://TestDestQueue1';
  SET OutputLocalEnvironment.Destination.JMSDestinationList.DestinationData[2]  = 'jndi://TestDestQueue2';
  SET OutputLocalEnvironment.Destination.JMSDestinationList.DestinationData[3]  = 'jndi://TestDestQueue3';
END;

ac16862_.htm | Last updated Friday, 21 July 2017