Author: ruwan
Date: Thu Sep 24 02:09:18 2009
New Revision: 818344
URL: http://svn.apache.org/viewvc?rev=818344&view=rev
Log:
Commiting for Supun, two-way JMS sample (SYNAPSE-582)
Added:
synapse/branches/1.3/repository/conf/sample/synapse_sample_264.xml
Modified:
synapse/branches/1.3/src/site/xdoc/Synapse_Samples.xml
Added: synapse/branches/1.3/repository/conf/sample/synapse_sample_264.xml
URL:
http://svn.apache.org/viewvc/synapse/branches/1.3/repository/conf/sample/synapse_sample_264.xml?rev=818344&view=auto
==============================================================================
--- synapse/branches/1.3/repository/conf/sample/synapse_sample_264.xml (added)
+++ synapse/branches/1.3/repository/conf/sample/synapse_sample_264.xml Thu Sep
24 02:09:18 2009
@@ -0,0 +1,37 @@
+<!--
+ ~ 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.
+ -->
+
+<!-- Switching from http/s to JMS -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+ <proxy name="StockQuoteProxy" transports="http">
+ <target>
+ <endpoint>
+ <address
uri="jms:/SimpleStockQuoteService?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616&transport.jms.DestinationType=queue"/>
+ </endpoint>
+ <inSequence>
+ <property action="set" name="transport.jms.ContentTypeProperty"
value="Content-Type" scope="axis2"/>
+ </inSequence>
+ <outSequence>
+ <property action="remove" name="TRANSPORT_HEADERS"
scope="axis2"/>
+ <send/>
+ </outSequence>
+ </target>
+ <publishWSDL
uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
+ </proxy>
+</definitions>
\ No newline at end of file
Modified: synapse/branches/1.3/src/site/xdoc/Synapse_Samples.xml
URL:
http://svn.apache.org/viewvc/synapse/branches/1.3/src/site/xdoc/Synapse_Samples.xml?rev=818344&r1=818343&r2=818344&view=diff
==============================================================================
--- synapse/branches/1.3/src/site/xdoc/Synapse_Samples.xml (original)
+++ synapse/branches/1.3/src/site/xdoc/Synapse_Samples.xml Thu Sep 24 02:09:18
2009
@@ -220,7 +220,10 @@
<li>
<a href="#Sample262">Sample 262: CBR of FIX messages </a></li>
<li>
-<a href="#Sample263">Sample 263: Transport switching - JMS to http/s using
JBoss Messaging(JBM) </a></li></ul></li>
+<a href="#Sample263">Sample 263: Transport switching - JMS to http/s using
JBoss Messaging(JBM) </a></li>
+<li>
+<a href="#Sample264">Sample 264: Transport switching - HTTP/S to JMS two way
messages</a></li>
+</ul></li>
<li>
<a href="#Task">Introduction to Synapse tasks</a>
<ul>
@@ -2755,8 +2758,8 @@
<p>Synapse will forward the order requests with symbol 'MSFT' to FIX endpoint
FIX-4.1 @ localhost:19877.</p>
<p>Synapse will not forward the orders with other symbols to any endpoint.
(default case has kept blank in the configuration)</p>
<p>To get an idea about the various transport parameters being used in this
sample see
-<a href="Synapse_Samples_Setup.html#fixparameters">FIX Transport Parameters
</a>. </p>
-
+<a href="Synapse_Samples_Setup.html#fixparameters">FIX Transport Parameters
</a>. </p>
+
<h2>
<a name="Sample263" id="Sample263">Sample 263: Transport switching - JMS to
http/s using JBoss Messaging(JBM) </a></h2>
<pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
@@ -2826,9 +2829,53 @@
<p>e.g. </p>
<pre xml:space="preserve"><parameter
name="transport.jms.Destination">dynamicTopics/something.TestTopic</parameter></pre>
+ <h2>
+ <a name="Sample264" id="Sample264">Sample 264: Sending Two-Way Messages
Using JMS transport</a>
+ </h2>
+ <pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
+ <proxy name="StockQuoteProxy" transports="http">
+ <target>
+ <endpoint>
+ <address
uri="jms:/SimpleStockQuoteService?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&
+
java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616&transport.jms.DestinationType=queue"/>
+ </endpoint>
+ <inSequence>
+ <property action="set"
name="transport.jms.ContentTypeProperty"
value="Content-Type" scope="axis2"/>
+ </inSequence>
+ <outSequence>
+ <property action="remove"
name="TRANSPORT_HEADERS" scope="axis2"/>
+ <send/>
+ </outSequence>
+ <target>
+ <publishWSDL
uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
+ </proxy>
+</definitions></pre>
+ <p>
+ <strong>Objective: Demonstrate sending request response scenario with JMS
transport</strong>
+ </p>
+ <p>
+ <strong>Prerequisites:</strong>
+ <br></br>You need to set up synpase and axis2 server to use the JMS
transport. See
+ <a href="#Sample251">Sample 251</a> for more details.
+ </p>
+ <p>
+ This sample is similar to the <a href="#Sample251">Sample 251</a>. Only
difference is we are expecting a response from the server. JMS transport uses
<strong>transport.jms.ContentTypeProperty</strong> to
+ determine the content type of the response message. If this property is
not set JMS transport treats the incoming message as plain text.
+ </p>
+ <p>
+ In the out path we remove the message context property
<strong>TRANSPORT_HEADERS</strong>. If these property is not removed JMS
headers will be passed to the client.
+ </p>
+ <p>Start Synpase using sample 264.</p>
+ <pre xml:space="preserve">synapse.bat/synapse.sh -sample 264</pre>
+ <p>Start Axis2 server with SimpleStockService deployed</p>
+ <p>Invoke the stockquote client using the following command.</p>
+ <pre xml:space="preserve">ant stockquote
-Daddurl=http://localhost:8280/services/StockQuoteProxy -Dsymbol=MSFT</pre>
+ <p>The sample Axis2 server console will print a message indicating that it
has received the request: </p>
+ <pre xml:space="preserve">Generating quote for : MSFT</pre>
+ <p>In the client side it shoud print a message indicating it has received
the price.</p>
+ <pre xml:space="preserve"> Standard :: Stock price =
$154.31851804993238</pre>
-
-<h1>
+ <h1>
<a name="Task" id="Task">Introduction to Synapse Tasks</a> </h1>
<h2>
<a name="Sample300" id="Sample300">Sample 300: Introduction to Tasks with
simple trigger</a></h2>