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 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 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.
To make this possible, the message handlers are specified in two distinct
parts of the pipeline configuration file:
- 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.
Remember: At run time, a message handler can choose
to curtail the execution of the pipeline. Therefore, even if CICS decides
that a particular message handler should be called based on what is in the
pipeline configuration file, the decision might be overruled by an earlier
message handler.
The message handlers that are specified within the transport
section (the
transport-related handlers) are organized into several
lists. At run time, CICS selects the handlers in just one of these lists
for execution, based on which transport resources are in use. If more than
one list matches the transport resources that are being used, CICS uses the
list that is most selective. The lists that are used in both service provider
and service requester pipelines are:
- <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.
The following list of message handlers is used only in the
configuration file for a service provider pipeline:
- <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.
Remember: Any handlers specified in the service section of
the pipeline definition will be called in addition to those specified in the
transport section.