About the Video Rental message flow

The following diagram shows the Video message flow.

The Video sample message flow. Click the nodes in this figure to read what each node does.

For information about message flows, see Message flows overview in the WebSphere Message Broker documentation.

How the message flow works

The Video message flow extracts information from input messages about the customer's personal details and videos the customer has got on loan. You can use this message flow to see how the CWF, XML, and TDS input messages are parsed as they are passed through the message flow. The Video message flow performs the following actions:

  1. Identifies the input message as having either a CWF, XML, or TDS physical format
  2. Fully parses the input message
  3. Extracts information from the input message about the customer's name and the videos the customer has on loan, and multiplies the value of the Cost field in the input message by two
  4. Outputs the transformed message to the user

For more information, see Physical formats in the MRM domain in the WebSphere Message Broker documentation.

The following table describes the tasks performed by each node in the Video message flow.

Node name Node type Tasks performed by node
VIDEO_XML_IN MQInput
  1. Gets the input message from the input queue (also called VIDEO_XML_IN).
  2. Passes the input message, through the Out terminal, to the Extract Fields node. Alternatively, if there is a problem identifying the input message, VIDEO_XML_IN passes the input message, through the Failure terminal, to the VIDEO_FAIL node. If an exception occurs downstream in the message flow and the message is rolled back to VIDEO_XML_IN, the node passes the input message, through the Catch terminal, to the VIDEO_FAIL node.
VIDEO_TDS_IN MQInput
  1. Gets the input message from the input queue (also called VIDEO_TDS_IN).
  2. Passes the input message, through the Out terminal, to the Extract Fields node. Alternatively, if there is a problem identifying the input message, VIDEO_TDS_IN passes the input message, through the Failure terminal, to the VIDEO_FAIL node. If an exception occurs downstream in the message flow and the message is rolled back to VIDEO_TDS_IN, the node passes the input message, through the Catch terminal, to the VIDEO_FAIL node.
VIDEO_CWF_IN MQInput
  1. Gets the input message from the input queue (also called VIDEO_CWF_IN).
  2. Passes the input message, through the Out terminal, to the Extract Fields node. Alternatively, if there is a problem identifying the input message, VIDEO_CWF_IN passes the input message, through the Failure terminal, to the VIDEO_FAIL node. If an exception occurs downstream in the message flow and the message is rolled back to VIDEO_CWF_IN, the node passes the input message, through the Catch terminal, to the VIDEO_FAIL node.
VIDEO_OUT MQOutput Puts the input message, which now contains information only about the customer's name and the videos that the customer has on loan, on the VIDEO_OUT queue.
VIDEO_FAIL MQOutput If there is a problem processing the message, the input message is put on the VIDEO_FAIL queue.
Extract Fields Compute
  1. Extracts information from the input message about the customer's name and the video that the customer has on loan.
  2. Multiplies the value of the Cost field in the input message by two.
  3. Passes the changed message, through the Out terminal, to the VIDEO_OUT node. The message now contains information only about the customer's name and the videos that the customer has on loan.

For more information, see Built-in nodes in the WebSphere Message Broker documentation.

The input message contains information about the following details:

After the message has passed through the Video message flow, the message contains information only about the customer's name, and the videos the customer has on loan. In addition, the Extract Fields node has multiplied the value of the Cost field by two.

The purpose of putting the input message through the message flow is to show that the message can be parsed successfully in its various formats. It also demonstrates the ESQL syntax for referencing parts of a message that are in different namespaces. For more information, see Accessing the content of a message in the MRM domain with namespace support enabled in the WebSphere Message Broker documentation.

Back to sample home