WebSphere MQ Adapter 6.5 | webMethods WebSphere MQ Adapter Documentation | webMethods WebSphere MQ Adapter Installation and User’s Guide Documentation | Adapter Connections | Dynamically Changing a Service's Connection at Run Time
Dynamically Changing a Service's Connection at Run Time
You can run a service using a connection other than the default connection that was associated with the service when the service was created. To override the default, you must code your flow to pass a value through the pipeline into a service's $connectionName field.
For example, you have a flow whose purpose is to take input from one queue and direct it to one of three output queues, each representing a department within your company - billing, shipping, and personnel. Each document in the input queue contains a field called Recipient. One WebSphere MQ service could act as a router, using the value in the input document's Recipient field to set the value for $connectionName. Then the flow would use $connectionName to dynamically pick a connection (output queue) to use to send the input to the appropriate corporate department.
Keep in mind these restrictions when using dynamic connections:
*The connection with which you override the default (that is, the value provided for $connectionName) must be configured to use the same connection type as the default connection.
*The $connectionName field is present only in services that are created with Designer.
*The adapter ignores the $connectionName field if you provide values for one or more objects in the overrideConnection property.
For more information, see Programmatically Supply a Value for $connectionName at Run Time.