Transport-related handlers
In the configuration file for each pipeline, you can specify more than one set of message handlers. At run time, CICS® selects the message handlers that are called, based upon the resources that are being used for the message transport.
In a service provider, and in a service requester, you can specify that some message handlers should be called only when a particular transport (HTTP or WebSphere® MQ) is in use. For example, consider a web service that you make available to your employees. Those who work at a company location access the service using the WebSphere MQ transport on a secure internal network; however, employees working at a business partner location access the service using the HTTP transport over the internet. In this situation, you might want to use message handlers to encrypt parts of the message when the HTTP transport is used, because of the sensitive nature of the information.
In a service provider, inbound messages are associated with a named resource (a TCPIPSERVICE for the HTTP transport, a QUEUE for the MQ transport). You can specify that some message handlers should be called only when a particular resource is used for an inbound request.
- The service section
- Specifies the message handlers that are called each time the pipeline executes.
- The transport section
- Specifies the message handlers that might or might not be called, depending upon the transport resources that are in use.
- <default_transport_handler_list>
- This is the least selective list of transport-related handlers; the handlers specified in this list are called when none of the following lists matches the transport resources that are being used.
- <default_http_transport_handler_list>
- In a service requester pipeline, the handlers in this list are
called when the HTTP transport is in use.
In a service provider pipeline, the handlers in this list are called when the HTTP transport is in use, and no <named_transport_entry> names the TCPIPSERVICE for the TCP/IP connection.
- <default_mq_transport_handler_list>
- In a service requester pipeline, the handlers in this list are
called when the WebSphere MQ transport is in use.
In a service provider pipeline, the handlers in this list are called when the WebSphere MQ transport is in use, and no <named_transport_entry> names the message queue on which inbound messages are received.
- <named_transport_entry>
- As well as a list of handlers, the <named_transport_entry> specifies
the name of a resource, and the transport type.
- For the HTTP transport, the handlers in this list are called when the resource name matches the name of the TCPIPSERVICE for the inbound TCP/IP connection.
- For the WebSphere MQ transport, the handlers in this list are called when the resource name matches the name of the message queue that receives the inbound message.
Example
This is an example of a <transport> element from the pipeline configuration file for a service provider pipeline:<transport>
<!-- HANDLER1 and HANDLER2 are the default transport handlers -->
<default_transport_handler_list>
<handler><program>HANDLER1</program><handler_parameter_list/></handler>
<handler><program>HANDLER2</program><handler_parameter_list/></handler>
</default_transport_handler_list>
<!-- HANDLER3 overrides defaults for MQ transport -->
<default_mq_transport_handler_list>
<handler><program>HANDLER3</program><handler_parameter_list/></handler>
</default_mq_transport_handler_list>
<!-- HANDLER4 overrides defaults for http transport with TCPIPSERVICE(WS00) -->
<named_transport_entry type="http">
<name>WS00</name>
<transport_handler_list>
<handler><program>HANDLER4</program><handler_parameter_list/></handler>
</transport_handler_list>
</named_transport_entry>
</transport>
The effect of this definition is this:- The <default_mq_transport_handler_list> ensures that messages that use the MQ transport are processed by handler HANDLER3.
- The <named_transport_entry> ensures that messages that use the TCP/IP connection associated with TCPIPSERVICE(WS00) are processed by handler HANDLER4.
- The <default_transport_handler_list> ensures that all remaining messages, that is, those that use the HTTP transport, but not TCPISERVICE(WS00), are processed by handlers HANDLER1 and HANDLER2.