You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by hi...@apache.org on 2010/12/26 04:35:42 UTC

svn commit: r1052826 - in /synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide: samples.xml samples/sample262.xml samples/sample264.xml samples/sample265.xml samples/sample266.xml samples/sample300.xml

Author: hiranya
Date: Sun Dec 26 03:35:41 2010
New Revision: 1052826

URL: http://svn.apache.org/viewvc?rev=1052826&view=rev
Log:
Transport samples and tasks


Modified:
    synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml
    synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample262.xml
    synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample264.xml
    synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample265.xml
    synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample266.xml
    synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample300.xml

Modified: synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml?rev=1052826&r1=1052825&r2=1052826&view=diff
==============================================================================
--- synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml (original)
+++ synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml Sun Dec 26 03:35:41 2010
@@ -112,11 +112,11 @@
                         <li><a href="samples/sample259.html">Sample 259: Switching from FIX to HTTP </a></li>
                         <li><a href="">Sample 260: Switching from FIX to AMQP </a></li>
                         <li><a href="samples/sample261.html">Sample 261: Switch between different FIX versions </a></li>
-                        <li><a href="">Sample 262: CBR of FIX messages </a></li>
+                        <li><a href="samples/sample262.html">Sample 262: Content Based Routing of FIX messages </a></li>
                         <li><a href="">Sample 263: Transport switching - JMS to http/s using JBoss Messaging (JBM)</a></li>
-                        <li><a href="">Sample 264: Transport switching - HTTP/S to JMS two way messages</a></li>
-                        <li><a href="">Sample 265: Switching from TCP to HTTP/S</a></li>
-                        <li><a href="">Sample 266: Switching from UDP to HTTP/S</a></li>
+                        <li><a href="samples/sample264.html">Sample 264: Request-response invocations with the JMS transport</a></li>
+                        <li><a href="samples/sample265.html">Sample 265: Switching from TCP to HTTP/S</a></li>
+                        <li><a href="samples/sample266.html">Sample 266: Switching from UDP to HTTP/S</a></li>
                     </ul>
                 </p>
             </subsection>

Modified: synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample262.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample262.xml?rev=1052826&r1=1052825&r2=1052826&view=diff
==============================================================================
--- synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample262.xml (original)
+++ synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample262.xml Sun Dec 26 03:35:41 2010
@@ -23,7 +23,7 @@
         <title>Apache Synapse - Sample 262</title>
     </properties>
     <body>
-        <section name="Sample 262: ">
+        <section name="Sample 262: Content Based Routing of FIX Messages">
             <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
 
     &lt;sequence name="CBR_SEQ"&gt;
@@ -72,14 +72,33 @@
 &lt;/definitions&gt;</div>
             <subsection name="Objective">
                 <p>
-
+                    Show case the ability of Synapse to route FIX messages based on the content they
+                    carry.
                 </p>
             </subsection>
             <subsection name="Pre-requisites">
                 <p>
                     <ul>
                         <li>
-                            Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+                            You need a <a href="http://www.quickfixj.org">Quickfix/J</a> installation
+                            to try out FIX samples. Please download and extract a Quickfix/J distribution
+                            into your local machine.
+                        </li>
+                        <li>
+                            Configure the Executor sample FIX application (shipped with Quickfix/J)
+                            to receive messages from Synapse and start it (refer FIX setup guide for
+                            more details). In previous samples we only had a FIX 4.0 session configured
+                            for Executor. For this sample we should also configure a FIX 4.1 session for
+                            Executor. Therefore before starting it add the following entries to the
+                            configuration file of Executor. (Do not remove or change the FIX 4.0
+                            configuration already available in this file)
+                            <div class="consoleOutput">[session]
+BeginString=FIX.4.1
+SocketAcceptPort=19877</div>
+                        </li>
+                        <li>
+                            Enable the FIX transport listener and sender for Synapse (refer FIX setup
+                            guide for details).
                         </li>
                         <li>
                             Start Synapse using the configuration numbered 262 (repository/conf/sample/synapse_sample_262.xml)
@@ -87,16 +106,31 @@
                                 Unix/Linux: sh synapse.sh -sample 262<br/>
                                 Windows: synapse.bat -sample 262
                             </div>
+                            If the Executor was configured properly Synapse should establish 2 sessions
+                            with Executor upon startup (FIX 4.0 session and FIX 4.1 session)
+                        </li>
+                        <li>
+                            Configure Banzai sample FIX application (shipped with Quickfix/J) to send
+                            messages to Synapse and start it (refer FIX setup guide for more details).
+                            You should also add the following entry to the Banzai configuration file
+                            before starting it (replace $SYNAPSE_HOME with the actual path to Synapse
+                            home).
+                            <div class="consoleOutput">DataDictionary=$SYNAPSE_HOME/repository/conf/sample/resources/fix/FIX40-synapse.xml</div>
+                            If Banzai was properly configured, it should establish a FIX 4.0 session with
+                            Synapse upon startup. You should see some session logon messages on Synapse
+                            console and Banzai console.
                         </li>
                     </ul>
                 </p>
             </subsection>
             <subsection name="Executing the Client">
-                <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/</div>
-
-                <div class="consoleOutput">Sat Nov 18 21:01:23 IST 2006 SimpleStockQuoteService :: Generating quote for : IBM</div>
-
-                <div class="consoleOutput">Standard :: Stock price = $95.26454380258552</div>
+                <p>
+                    Send some order requests from Banzai to Synapse containing the synbols 'GOOG' and
+                    'MSFT'. Synapse will forward the messages with the symbol 'GOOG' to the FIX 4.0
+                    session. Messages containing the symbol 'MSFT' will be sent to the FIX 4.1 session.
+                    Any other messages will be simply dropped by the service bus since the default case
+                    of the switch mediator has been kept empty.
+                </p>                
             </subsection>
         </section>
         <p><a href="../samples.html">Back to Catalog</a></p>        

Modified: synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample264.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample264.xml?rev=1052826&r1=1052825&r2=1052826&view=diff
==============================================================================
--- synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample264.xml (original)
+++ synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample264.xml Sun Dec 26 03:35:41 2010
@@ -23,7 +23,7 @@
         <title>Apache Synapse - Sample 264</title>
     </properties>
     <body>
-        <section name="Sample 264: ">
+        <section name="Sample 264: Request-Response Invocations with the JMS Transport">
             <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
 
     &lt;proxy name="StockQuoteProxy" transports="http"&gt;
@@ -47,14 +47,26 @@
 &lt;/definitions&gt;</div>
             <subsection name="Objective">
                 <p>
-
+                    In <a href="sample251.html">sample 251</a> we saw how to perform transport switching
+                    between HTTP and JMS using a one-way invocation. Here we will do HTTP to JMS switching
+                    with a two-way, request-response invocation.
                 </p>
             </subsection>
             <subsection name="Pre-requisites">
                 <p>
                     <ul>
                         <li>
-                            Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
+                            Setup and start a JMS broker (Apache ActiveMQ can be used as the
+                            JMS broker for this scenario. Refer JMS setup guide for information on
+                            how to run ActiveMQ.)
+                        </li>
+                        <li>
+                            Enable the JMS transport receiver of the sample Axis2 server (Refer JMS
+                            setup guide for details)
+                        </li>
+                        <li>
+                            Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2 (Since
+                            the JMS receiver is enabled, Axis2 will start polling on a JMS queue)
                         </li>
                         <li>
                             Start Synapse using the configuration numbered 264 (repository/conf/sample/synapse_sample_264.xml)
@@ -67,11 +79,18 @@
                 </p>
             </subsection>
             <subsection name="Executing the Client">
-                <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/</div>
-
-                <div class="consoleOutput">Sat Nov 18 21:01:23 IST 2006 SimpleStockQuoteService :: Generating quote for : IBM</div>
-
-                <div class="consoleOutput">Standard :: Stock price = $95.26454380258552</div>
+                <p>
+                    Send a stock quote request to Synapse over HTTP using the following command.
+                </p>
+                <div class="command">ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy -Dsymbol=MSFT</div>
+                <p>
+                    The proxy service will send the message to the JMS queue named SimpleStockQuoteService
+                    and wait for a response to arrive. In fact the JMS sender in Synapse will create a temporary
+                    queue to start polling on that queue for the response. The address of this queue will
+                    be sent on the request as a JMS header. Axis2 server will consumer the request from the
+                    queue and place a response on the temporary queue created by Synapse. At this point
+                    Synapse will pick up the response and forward it back to the Axis2 client over HTTP.
+                </p>                
             </subsection>
         </section>
         <p><a href="../samples.html">Back to Catalog</a></p>        

Modified: synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample265.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample265.xml?rev=1052826&r1=1052825&r2=1052826&view=diff
==============================================================================
--- synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample265.xml (original)
+++ synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample265.xml Sun Dec 26 03:35:41 2010
@@ -23,7 +23,7 @@
         <title>Apache Synapse - Sample 265</title>
     </properties>
     <body>
-        <section name="Sample 265: ">
+        <section name="Sample 265: Switching from TCP to HTTP/S">
             <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
 
     &lt;proxy name="StockQuoteProxy" transports="tcp"&gt;
@@ -41,7 +41,8 @@
 &lt;/definitions&gt;</div>
             <subsection name="Objective">
                 <p>
-
+                    Demonstrate the ability of Synapse to receive raw TCP messages and send them to
+                    HTTP endpoints
                 </p>
             </subsection>
             <subsection name="Pre-requisites">
@@ -51,21 +52,52 @@
                             Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
                         </li>
                         <li>
+                            Enable the TCP transport receiver for Synapse (refer TCP transport setup
+                            guide).
+                        </li>
+                        <li>
                             Start Synapse using the configuration numbered 265 (repository/conf/sample/synapse_sample_265.xml)
                             <div class="command">
                                 Unix/Linux: sh synapse.sh -sample 265<br/>
                                 Windows: synapse.bat -sample 265
                             </div>
                         </li>
+                        <li>
+                            Enable the TCP transport sender for the sample Axis2 client (refer TCP transport
+                            setup guide for details).
+                        </li>
                     </ul>
                 </p>
             </subsection>
             <subsection name="Executing the Client">
-                <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/</div>
-
-                <div class="consoleOutput">Sat Nov 18 21:01:23 IST 2006 SimpleStockQuoteService :: Generating quote for : IBM</div>
-
-                <div class="consoleOutput">Standard :: Stock price = $95.26454380258552</div>
+                <p>
+                    This sample is similar to <a href="sample250.html">Sample 250</a>. Only difference
+                    is instead of the JMS transport we will be using the TCP transport to receive
+                    messages. TCP is not an application layer protocol. Hence there are no application
+                    level headers available in the requests. Synapse has to simply read the XML content
+                    coming through the socket and dispatch it to the right proxy service based on the
+                    information available in the message payload itself. The TCP transport is capable
+                    of dispatching requests based on addressing headers or the first element in the
+                    SOAP body. In this sample, we will get the sample client to send WS-Addressing
+                    headers in the request. Therefore the dispatching will take place based on the
+                    addressing header values.
+                </p>
+                <p>
+                    Invoke the stockquote client using the following command. Note the TCP URL in the
+                    command.
+                </p>
+                <div class="command">ant stockquote -Daddurl=tcp://localhost:6060/services/StockQuoteProxy -Dmode=placeorder</div>
+                <p>
+                    The TCP transport will receive the message and hand it over to the mediation engine.
+                    Synapse will dispatch the request to the StockQuoteProxy service based on the
+                    addressing header values.
+                </p>
+                <p>
+                    When the proxy service forwards the message to the sample Axis2 server over HTTP,
+                    sample server will print the following entry to confirm that the request has
+                    been received.
+                </p>
+                <div class="consoleOutput">Thu May 20 12:25:01 IST 2010 samples.services.SimpleStockQuoteService  :: Accepted order #1 for : 17621 stocks of IBM at $ 73.48068475255796</div>
             </subsection>
         </section>
         <p><a href="../samples.html">Back to Catalog</a></p>        

Modified: synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample266.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample266.xml?rev=1052826&r1=1052825&r2=1052826&view=diff
==============================================================================
--- synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample266.xml (original)
+++ synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample266.xml Sun Dec 26 03:35:41 2010
@@ -23,7 +23,7 @@
         <title>Apache Synapse - Sample 266</title>
     </properties>
     <body>
-        <section name="Sample 266: ">
+        <section name="Sample 266: Switching from UDP to HTTP/S">
             <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
 
     &lt;proxy name="StockQuoteProxy" transports="udp"&gt;
@@ -44,7 +44,7 @@
 &lt;/definitions&gt;</div>
             <subsection name="Objective">
                 <p>
-
+                    Showcase the ability of Synapse to receive and process raw UDP messages
                 </p>
             </subsection>
             <subsection name="Pre-requisites">
@@ -54,21 +54,44 @@
                             Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
                         </li>
                         <li>
+                            Enable the UDP transport receiver for Synapse (refer UDP transport setup
+                            guide).
+                        </li>
+                        <li>
                             Start Synapse using the configuration numbered 266 (repository/conf/sample/synapse_sample_266.xml)
                             <div class="command">
                                 Unix/Linux: sh synapse.sh -sample 266<br/>
                                 Windows: synapse.bat -sample 266
                             </div>
                         </li>
+                        <li>
+                            Enable the UDP transport sender for the sample Axis2 client (refer UDP transport
+                            setup guide for details).
+                        </li>
                     </ul>
                 </p>
             </subsection>
             <subsection name="Executing the Client">
-                <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/</div>
-
-                <div class="consoleOutput">Sat Nov 18 21:01:23 IST 2006 SimpleStockQuoteService :: Generating quote for : IBM</div>
-
-                <div class="consoleOutput">Standard :: Stock price = $95.26454380258552</div>
+                <p>
+                    This sample is similar to <a href="sample265.html">Sample 265</a>. Only difference
+                    is instead of the TCP transport we will be using the UDP transport to receive
+                    messages.
+                </p>
+                <p>
+                    Invoke the stockquote client using the following command. Note the UDP URL in the
+                    command.
+                </p>
+                <div class="command">ant stockquote -Daddurl=udp://localhost:9999?contentType=text/xml -Dmode=placeorder</div>
+                <p>
+                    Since we have configured the content type as text/xml for the proxy service,
+                    incoming messages will be processed as SOAP 1.1 messages.
+                </p>
+                <p>
+                    When the proxy service forwards the message to the sample Axis2 server over HTTP,
+                    sample server will print the following entry to confirm that the request has
+                    been received.
+                </p>
+                <div class="consoleOutput">Thu May 20 12:25:01 IST 2010 samples.services.SimpleStockQuoteService  :: Accepted order #1 for : 17621 stocks of IBM at $ 73.48068475255796</div>
             </subsection>
         </section>
         <p><a href="../samples.html">Back to Catalog</a></p>        

Modified: synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample300.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample300.xml?rev=1052826&r1=1052825&r2=1052826&view=diff
==============================================================================
--- synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample300.xml (original)
+++ synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample300.xml Sun Dec 26 03:35:41 2010
@@ -23,7 +23,7 @@
         <title>Apache Synapse - Sample 300</title>
     </properties>
     <body>
-        <section name="Sample 300: ">
+        <section name="Sample 300: Introduction to Synapse Tasks">
             <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
 
     &lt;task class="org.apache.synapse.startup.tasks.MessageInjector" name="CheckPrice"&gt;
@@ -61,7 +61,7 @@
 &lt;/definitions&gt;</div>
             <subsection name="Objective">
                 <p>
-
+                    Demonstrate how to schedule tasks in the Synapse runtime for periodic execution
                 </p>
             </subsection>
             <subsection name="Pre-requisites">
@@ -81,11 +81,23 @@
                 </p>
             </subsection>
             <subsection name="Executing the Client">
-                <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/</div>
-
-                <div class="consoleOutput">Sat Nov 18 21:01:23 IST 2006 SimpleStockQuoteService :: Generating quote for : IBM</div>
-
-                <div class="consoleOutput">Standard :: Stock price = $95.26454380258552</div>
+                <p>
+                    The above configuration adds a scheduled task to the Synapse runtime. The task
+                    is configured to run every 5 minutes (note the interval attribute on the trigger
+                    element).
+                </p>
+                <p>
+                    One can write his/her own tasks implementing the org.apache.synapse.task.Task
+                    interface and implementing the execute method to run the necessary logic. For
+                    this particular sample we have used the MessageInjector class which just injects
+                    a message into Synapse environment. In the configuration we have set the message
+                    payload to be the stock quote request payload.
+                </p>
+                <p>
+                    In this sample, injected messages will be sent to the sample Axis2 server which
+                    will send back a response to Synapse. So every 5 minutes you will notice that Axis2
+                    is generating a quote and Synapse is receiving the stock quote response.
+                </p>
             </subsection>
         </section>
         <p><a href="../samples.html">Back to Catalog</a></p>