Library Link To Toggle Frames Print Feedback

Message Mode

In message mode the router sees messages as a stream of bytes.

[Note] Note

The byte stream can be transformed into a string representation of the message as it looks on the wire.

Message handling

When the router operates in message mode only the transport layer processes the message. The message is taken off of the wire by the transport which processes any transport specific headers and packages the message into an inputstream. The inputstream contains the message as it is described in the WSDL binding element of the service's interface. When using most of the features of the router, the inputstream is converted into a String.

When using the transport bridging feature you can optimize the router by using streaming. When you use the streaming optimization the inputstream is passed through the router and forwarded directly to the outbound routers.

Example

The SEI shown in Example 4.1, “Interface for Routing with POJO Mode” would generate a WSDL binding element similar to the one shown in Example 4.5, “Generated WSDL Binding”.

Example 4.5. Generated WSDL Binding

<wsdl:binding name="quoteReporter" type="tns:quoteReporter">
  <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
  <wsdl:operation name="getQuote">
    <soap:operation style="rpc" />
    <wsdl:input name="getQuote">
      <soap:body use="literal" />
    </wsdl:input>
    <wsdl:output name="getQuoteResponse">
      <soap:body use="literal" />
    </wsdl:output>
  </wsdl:operation>
</wsdl:binding>

This binding specifies that the messages sent from the endpoint are SOAP messages. Therefore, the messages passed into the router will contain a SOAP envelope along with the message payload. Example 4.6, “SOAP Message” shows an example of a message generated from the binding in Example 4.5, “Generated WSDL Binding”.

Example 4.6. SOAP Message

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<SOAP-ENV:Envelope
   SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
   xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
   xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
   xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
   xmlns:xsd="http://www.w3.org/1999/XMLSchema">
  <SOAP-ENV:Body>
    <ns1:getQuote xmlns:ns1="mySoapService">
      <arg0 xsi:type="xsd:string">someString</arg0>
      <arg1 xsi:type="xsd:boolean">false</arg1>
    <getQuote>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Supported features

Message mode is supported by the following features of the router:

  • content-based routing

  • transport bridging [1]

  • fail-over routing

  • message broadcasting

  • load balancing

  • chained processing

  • routing slip routes

  • recipient list routes

Strengths and weaknesses

Message mode is the fastest of the three data modes. It is also supported by most of the router's features.

However, it is not supported by the message format switching feature. It also does not fully support all features of transport level switching. Specifically, it does not support the propagation of transport specific fault codes. It also does not support the propagation of HTTP response codes.

When creating message processing components you must interact with complex XML documents. These documents are highly dependent on the underlying service contract. If you switch the type of binding used by your service, you will need to refactor any custom processing done by a router using message mode.

Message mode does not support the use of WS-Addressing headers. Therefore any features that use WS-Addressing information, such as WS-RM, cannot be used when the router is using message mode.



[1] Supports the streaming optimization.