Author: charith
Date: Thu Jan 5 07:28:34 2012
New Revision: 1227509
URL: http://svn.apache.org/viewvc?rev=1227509&view=rev
Log:
adding sample 700 , 701, 702
Added:
synapse/branches/2.1/src/site/xdoc/userguide/samples/sample701.xml
synapse/branches/2.1/src/site/xdoc/userguide/samples/sample702.xml
Modified:
synapse/branches/2.1/src/site/xdoc/userguide/samples.xml
synapse/branches/2.1/src/site/xdoc/userguide/samples/sample700.xml
Modified: synapse/branches/2.1/src/site/xdoc/userguide/samples.xml
URL:
http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples.xml?rev=1227509&r1=1227508&r2=1227509&view=diff
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples.xml (original)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples.xml Thu Jan 5
07:28:34 2012
@@ -237,10 +237,12 @@
</ul>
</p>
</subsection>
- <subsection name="Message Store and Dead Letter Channel">
+ <subsection name="Message Stores and Message Processors">
<p>
<ul>
- <li><a href="samples/sample700.html">Sample 700:
Introduction to Synapse message stores</a></li>
+ <li><a href="samples/sample700.html">Sample 700:
Introduction to Synapse Message Stores</a></li>
+ <li><a href="samples/sample701.html">Sample 701:
Introduction to Message Sampling Processor</a></li>
+ <li><a href="samples/sample702.html">Sample 702:
Introduction to Message Forwarding Processor</a></li>
</ul>
</p>
</subsection>
Modified: synapse/branches/2.1/src/site/xdoc/userguide/samples/sample700.xml
URL:
http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample700.xml?rev=1227509&r1=1227508&r2=1227509&view=diff
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample700.xml
(original)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample700.xml Thu Jan
5 07:28:34 2012
@@ -24,54 +24,48 @@
</properties>
<body>
<section name="Sample 700: Introduction to Synapse Message Stores">
- <div class="xmlConf"><definitions
xmlns="http://ws.apache.org/ns/synapse">
- <!--Simple in Memory Message Store with name foo -->
- <messageStore name="foo" sequence="bar">
- <redelivery>
- <!--retry interval 1 sec -->
- <interval>1</interval>
- <!--Message will be stored after 2 redeliveries -->
- <maximumRedeliveries>2</maximumRedeliveries>
- <exponentialBackoff>true</exponentialBackoff>
- <backoffMutiplier>2</backoffMutiplier>
- </redelivery>
- </messageStore>
-
- <!-- filtering of messages with XPath and regex matches -->
- <filter source="get-property('To')" regex=".*/StockQuote.*">
- <send>
- <endpoint key="SampleEndpoint"/>
- </send>
+ <div class="xmlConf">
+ <!-- Introduction to the Message Store -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+ <sequence name="fault">
+ <log level="full">
+ <property name="MESSAGE" value="Executing default 'fault'
sequence"/>
+ <property name="ERROR_CODE"
expression="get-property('ERROR_CODE')"/>
+ <property name="ERROR_MESSAGE"
+ expression="get-property('ERROR_MESSAGE')"/>
+ </log>
<drop/>
- </filter>
- <send/>
- <!-- Endpoint named SampleEndpoint-->
- <endpoint name="SampleEndpoint" onFault="foo">
- <address
uri="http://localhost:9000/services/SimpleStockQuoteService">
- <suspendDurationOnFailure>2</suspendDurationOnFailure>
- </address>
- </endpoint>
-
- <sequence name="bar">
- <log level="full"/>
</sequence>
-</definitions></div>
+ <sequence name="onStoreSequence">
+ <log>
+ <property name="On-Store" value="Storing message"/>
+ </log>
+ </sequence>
+ <sequence name="main">
+ <in>
+ <log level="full"/>
+ <property name="FORCE_SC_ACCEPTED" value="true"
scope="axis2"/>
+ <store messageStore="MyStore" sequence="onStoreSequence"/>
+ </in>
+ <description>The main sequence for the message
mediation</description>
+ </sequence>
+ <messageStore name="MyStore"/>
+</definitions>
+ </div>
<subsection name="Objective">
<p>
- Demonstrate the usage of Synapse message stores and how to
use a message store
- to implement the popular 'Dead Letter Channel' integration
pattern
+ Introduction to Message Stores
</p>
</subsection>
<subsection name="Pre-requisites">
<p>
<ul>
<li>
- Deploy the SimpleStockQuoteService in the sample
Axis2 server and start Axis2
- </li>
- <li>
- Start Synapse using the configuration numbered 700
(repository/conf/sample/synapse_sample_700.xml)
+ Start Synapse using the configuration numbered 700
+ (repository/conf/sample/synapse_sample_700.xml)
<div class="command">
- Unix/Linux: sh synapse.sh -sample 700<br/>
+ Unix/Linux: sh synapse.sh -sample 700
+ <br/>
Windows: synapse.bat -sample 700
</div>
</li>
@@ -82,21 +76,38 @@
<p>
First execute the sample client as follows.
</p>
- <div class="command">ant stockquote
-Dtrpurl=http://localhost:8280/soap/StockQuote</div>
+ <div class="command">ant stockquote
+
-Daddurl=http://localhost:9000/services/SimpleStockQuoteService
+ -Dtrpurl=http://localhost:8280/ -Dmode=placeorder
+ </div>
<p>
- Since you have the sample Axis2 server running, you will
get a stock quote response
- at the client side. Axis2 server will also print a log
confirming the generation
- of a new quote value. Now shut the Axis2 server down and
invoke the sample client
- again. Now Synapse will attempt twice to deliever the
message and faling that, the
- message will be stored in the specified in-memory message
store (dead letter channel)
- for later delivery.
+ When you execute the client the message will be dispatched
to the main sequence.
+ In the Main sequence store mediator will store the
placeOrder request message in
+ the "MyStore" Message Store
</p>
<p>
Now you can use the JMX view of the Synapse message store
to see the message
stored in the dead letter channel and manually retry on
them.
- </p>
+ </p>
+ <p>Before Storing the message store mediator will invoke the
sequence
+ :onStoreSequence. See the log
+ </p>
+ <p>INFO - LogMediator To:
http://localhost:9000/services/SimpleStockQuoteService,
+ WSAction: urn:placeOrder, SOAPAction: urn:placeOrder,
ReplyTo:
+ http://www.w3.org/2005/08/addressing/none, MessageID:
+ urn:uuid:54f0e7c6-7b43-437c-837e-a825d819688c, Direction:
request, On-Store =
+ Storing message
+ </p>
+
+
+ <p>You can then use the JMX view of Synapse Message Store by
using the jconsole and
+ view the stored
+ Messages and delete them.
+ </p>
</subsection>
</section>
- <p><a href="../samples.html">Back to Catalog</a></p>
+ <p>
+ <a href="../samples.html">Back to Catalog</a>
+ </p>
</body>
-</document>
\ No newline at end of file
+</document>
Added: synapse/branches/2.1/src/site/xdoc/userguide/samples/sample701.xml
URL:
http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample701.xml?rev=1227509&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample701.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample701.xml Thu Jan
5 07:28:34 2012
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<document>
+ <properties>
+ <title>Apache Synapse - Sample 701</title>
+ </properties>
+ <body>
+ <section name="Sample 701: Introduction to Message Sampling Processor">
+ <div class="xmlConf">
+ <!-- Introduction to Message Sampling Processor -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+ <sequence name="send_seq">
+ <send>
+ <endpoint>
+ <address
uri="http://localhost:9000/services/SimpleStockQuoteService">
+ <suspendOnFailure>
+ <errorCodes>-1</errorCodes>
+ <progressionFactor>1.0</progressionFactor>
+ </suspendOnFailure>
+ </address>
+ </endpoint>
+ </send>
+ </sequence>
+ <sequence name="main">
+ <in>
+ <log level="full"/>
+ <property name="FORCE_SC_ACCEPTED" value="true"
scope="axis2"/>
+ <property name="OUT_ONLY" value="true"/>
+ <store messageStore="MyStore"/>
+ </in>
+ <description>The main sequence for the message
mediation</description>
+ </sequence>
+ <messageStore name="MyStore"/>
+ <messageProcessor
+
class="org.apache.synapse.message.processors.sampler.SamplingProcessor"
+ name="SamplingProcessor" messageStore="MyStore">
+ <parameter name="interval">20000</parameter>
+ <parameter name="sequence">send_seq</parameter>
+ </messageProcessor>
+</definitions>
+ </div>
+ <subsection name="Objective">
+ <p>
+ Introduction to Message Sampling Processor
+ </p>
+ </subsection>
+ <subsection name="Pre-requisites">
+ <p>
+ <ul>
+ <li>
+ Start the SimpleStockQuoteService if its not
already started
+ </li>
+ <li>
+ Start Synapse using the configuration numbered 701
+ (repository/conf/sample/synapse_sample_701.xml)
+ <div class="command">
+ Unix/Linux: sh synapse.sh -sample 701
+ <br/>
+ Windows: synapse.bat -sample 701
+ </div>
+ </li>
+ </ul>
+ </p>
+ </subsection>
+ <subsection name="Executing the Client">
+ <p>
+ Execute the Client few times with command :
+ </p>
+ <div class="command">ant stockquote
+
-Daddurl=http://localhost:9000/services/SimpleStockQuoteService
+ -Dtrpurl=http://localhost:8280/ -Dmode=placeorder
+ </div>
+
+ <p>When you execute the client the message will be dispatched
to the main sequence.
+ In the Main sequence store mediator will store the
placeOrder request message in
+ the
+ "MyStore" Message Store
+ </p>
+
+ <p>Message Processor will consume the messages and forward to
the send_seq sequence
+ in
+ configured rate.
+ </p>
+ <p>You will observe that service invocation rate is not
changing when increasing the
+ rate we
+ execute the client.
+ </p>
+ </subsection>
+ </section>
+ <p>
+ <a href="../samples.html">Back to Catalog</a>
+ </p>
+ </body>
+</document>
Added: synapse/branches/2.1/src/site/xdoc/userguide/samples/sample702.xml
URL:
http://svn.apache.org/viewvc/synapse/branches/2.1/src/site/xdoc/userguide/samples/sample702.xml?rev=1227509&view=auto
==============================================================================
--- synapse/branches/2.1/src/site/xdoc/userguide/samples/sample702.xml (added)
+++ synapse/branches/2.1/src/site/xdoc/userguide/samples/sample702.xml Thu Jan
5 07:28:34 2012
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<document>
+ <properties>
+ <title>Apache Synapse - Sample 702</title>
+ </properties>
+ <body>
+ <section name="Sample 702: Introduction to Message Forwarding
Processor">
+ <div class="xmlConf">
+ <!-- Introduction to Scheduled Message Forwarding Processor
-->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <endpoint name="StockQuoteServiceEp">
+ <address
uri="http://localhost:9000/services/SimpleStockQuoteService">
+ <suspendOnFailure>
+ <errorCodes>-1</errorCodes>
+ <progressionFactor>1.0</progressionFactor>
+ </suspendOnFailure>
+ </address>
+ </endpoint>
+ <sequence name="fault">
+ <log level="full">
+ <property name="MESSAGE" value="Executing default 'fault'
sequence"/>
+ <property name="ERROR_CODE"
expression="get-property('ERROR_CODE')"/>
+ <property name="ERROR_MESSAGE"
expression="get-property('ERROR_MESSAGE')"/>
+ </log>
+ <drop/>
+ </sequence>
+ <sequence name="main">
+ <in>
+ <log level="full"/>
+ <property name="FORCE_SC_ACCEPTED" value="true"
scope="axis2"/>
+ <property name="OUT_ONLY" value="true"/>
+ <property name="target.endpoint"
value="StockQuoteServiceEp"/>
+ <store messageStore="MyStore"/>
+ </in>
+ <description>The main sequence for the message
mediation</description>
+ </sequence>
+ <messageStore name="MyStore"/>
+ <messageProcessor
+
class="org.apache.synapse.message.processors.forward.ScheduledMessageForwardingProcessor"
+ name="ScheduledProcessor" messageStore="MyStore">
+ <parameter name="interval">10000</parameter>
+ </messageProcessor>
+</definitions>
+ </div>
+ <subsection name="Objective">
+ <p>
+ Introduction to Message Forwarding Processor
+ </p>
+ </subsection>
+ <subsection name="Pre-requisites">
+ <p>
+ <ul>
+ <li>
+ Start Synapse using the configuration numbered 702
+ (repository/conf/sample/synapse_sample_702.xml)
+ <div class="command">
+ Unix/Linux: sh synapse.sh -sample 702
+ <br/>
+ Windows: synapse.bat -sample 702
+ </div>
+ </li>
+ </ul>
+ </p>
+ </subsection>
+ <subsection name="Executing the Client">
+ <p>
+ Execute the Client few times with command :
+ </p>
+ <div class="command">ant stockquote
+
-Daddurl=http://localhost:9000/services/SimpleStockQuoteService
+ -Dtrpurl=http://localhost:8280/ -Dmode=placeorder
+ </div>
+
+ <p>Now Start the SimpleStockQuoteService</p>
+ <p>When you Start the service you will see message getting
delivered to the service.
+ Even
+ though service is down when we invoke it from the client
+ </p>
+ <p>Here in the Main sequence store mediator will store the
placeOrder request
+ message in the
+ "MyStore" Message Store
+ </p>
+ <p>Message Processor will send the message to the endpoint
configured as a message
+ context
+ property.
+ </p>
+ <p>Message processor will remove the message from the store
only if message
+ delivered
+ successfully
+ </p>
+ </subsection>
+ </section>
+ <p>
+ <a href="../samples.html">Back to Catalog</a>
+ </p>
+ </body>
+</document>