The Pager samples, Text Messenger and SurfWatch, demonstrate how to use different messaging styles to send messages to a pager application. The Text Messenger sample demonstrates point-to-point messaging, in which the sender application knows the destination of the message; the SurfWatch sample demonstrates publish/subscribe messaging, in which the sender and receiver applications are decoupled from each other. The publish/subscribe style of messaging is similar to posting a message on a notice board; the person who posts the message does not necessarily know who is going to read the message, and the people reading the message do not necessarily know who posted it on the notice board.
This topic describes the message flows and message sets that the Pager samples use to process the messages that are sent to the Pager application. For more information, see Message flows overview, Message modeling, and MQInput node in the IBM Integration Bus documentation.
When you use the Text Messenger application to send a message to the Pager sample, the message is processed by the TextMessenger message flow. The message flow appends the text Powered by IBM to the end of the message text, then passes the message to the Pager application.
The following figure shows the TextMessenger message flow.
The following table lists the types of nodes that are used in the TextMessenger message flow.
Node type | Node name |
---|---|
MQInput | TEXTMESSENGER |
Mapping | Mapping |
MQOutput | TEXTMESSENGER_FAIL; PAGER |
The TextMessenger message flow performs the following actions:
When the Text Messenger message flow appends the text to the message, it has to understand the structure of the message. The structure of the message is defined in an external message set, to which the message flow refers. Without this message definition, more complicated nodes in the message flow, such as the Mapping node, would not be able to process the incoming information; the Mapping node has to refer to information in the message definition to process the message.
When you use the Text Messenger application to send a message that reads, for example, This is my message to the pager., the message that enters the message flow looks like the following message:
<pager>
<text>This is my message to the pager.</text>
</pager>
The Mapping node, changes the message by appending the text Powered by IBM to the end of the message text. When the message leaves the message flow, it looks like the following message:
<pager>
<text>This is my message to the pager. Powered by IBM.</text>
</pager>
When the Surf Report Publisher application publishes messages, the messages are processed by the SurfWatch message flow. The SurfWatch message flow transforms the surf report messages into plain pager messages, and publishes each message to a topic corresponding to the name of the beach. Messages on the topics to which you have subscribed by using the Surf Report Publisher application are received by the Pager application. For more information, see Publish/subscribe in the IBM Integration Bus documentation.
The following diagram shows the SurfWatch message flow.
The following table lists the types of nodes that are used in the SurfWatch message flow.
Node type | Node name |
---|---|
MQInput | SURFWATCH |
Mapping | Mapping |
MQOutput | SURFWATCH_FAIL |
Publication | Publish Reports |
The SurfWatch message flow performs the following actions:
When the SurfWatch message flow transforms the message from the surf report format to pager format, it has to understand both the structure of the surf report input message and the structure of the pager output message. The structures of the messages are defined in an external message set, to which the message flow refers. Without these message definitions, more complicated nodes in the message flow, such as the Mapping node, would not be able to process the incoming information; the Mapping node has to refer to information in the message definitions to process the message.
When you use the Surf Report Publisher application to subscribe to surf reports concerning, for example, the Haleiwa beach, the message that enters the message flow looks like the following message:
<SurfWatch>
<TimeDate>21.05.03 09:52:13</TimeDate>
<Break>Pipeline</Break>
<Waves>4</Waves>
<Wind>Side-offshore</Wind>
</SurfWatch>
The Mapping node, transforms the message from a surf report message into a plain pager message. When the message leaves the message flow, it looks like the following message:
<Pager>
<text>SurfWatch 21.05.03 09:52:13 Pipeline: Side-offshore, waves 4m.</text>
</Pager>