Implementing Publication Flow
Implementing Publication Flow
6/28/2012 Page 1
1.Introduction...............................................................................................................................................................4 2.Message Flows Overview.........................................................................................................................................4 3.Publication Flow Implementation...........................................................................................................................4 4.Subscriber Flows Implementation..........................................................................................................................9
6/28/2012 Page 2
Date of Revision
11/10/2009
Revision Made By
Andrzej Adamczyk
Version Number
1.0
Description of Change
Initial Draft
6/28/2012 Page 3
1. Introduction
This document contains guide on how to implement set of message flows that participate in publish subscribe messaging pattern.
Topic
STOCK_USD
PUBLICATION_IN
Publication Flow
Topic
STOCK_JPY
STOCK_EUR
Topic
NEWS_EUR
6/28/2012 Page 4
6/28/2012 Page 5
5) Create new PublishSubscribeUseCase message flow project. 6) Create message flow in the default broker schema, named PublicationFlow. 7) Open message flow and drag and drop MQInput node, 2 Java compute nodes and 3 Publication nodes.
6/28/2012 Page 6
9) Set MQInput node message parsing properties to use PublishSubscribeMS message set and XMLNSC parser domain.
10) In advanced properties section set default topic to finance/news/stocks. This is the topic to which we will send all stock quotes in USD. By setting this property we instruct MQInput node to set Properties/Topic element of the message tree. This element is used by Publication node to retrieve topic name, unless RFH2 header exists.
11) Provide implementation to ConvertToEUR java compute node. Place java class in com.accenture.aicit.broker package. The method of this class overwrites default value of Message/Topic element (set by MQInput node) and modifies stock quote message to contain price in euro.
6/28/2012 Page 7
6/28/2012 Page 8
5) In the Basic properties section of the FileOutput node set output directory to c:\temp\eur
6/28/2012 Page 9
10) In Basic section of FileOutput node properties set directory to c:\temp\usd. 11) In Request section set properties in the similar way as in step 6.
6/28/2012 Page 10
15) In Basic section of FileOutput node properties set directory to c:\temp\jpy. 16) In Request section set data location and file name in similar way as in step 6. 17) Create new EURStockNewsFlow message flow. 18) Add MQInput, Mapping and MQOutput nodes to the flow.
6/28/2012 Page 11
6/28/2012 Page 12
25) Set Date element in output message to Timestamp element of the input message. 26) Set Message element of the output message to the following xPath expression. fn:concat($source/StockQuote/Symbol, ' sold for ', $source/StockQuote/Price, ' at ', fn:substring($source/StockQuote/Timestamp, 9, 2), ':', fn:substring($source/StockQuote/Timestamp, 11, 2))
6/28/2012 Page 13