You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by is...@apache.org on 2016/06/05 17:04:08 UTC
svn commit: r1746934 - in /synapse/trunk/java:
modules/documentation/src/site/xdoc/userguide/
modules/documentation/src/site/xdoc/userguide/samples/
modules/integration/src/test/resources/extras/ repository/conf/sample/
Author: isudana
Date: Sun Jun 5 17:04:08 2016
New Revision: 1746934
URL: http://svn.apache.org/viewvc?rev=1746934&view=rev
Log:
Respond mediator samples and documentation update patches by vanji, SYNAPSE-1033, SYNAPSE-1032
Added:
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample440.xml
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample441.xml
synapse/trunk/java/repository/conf/sample/synapse_sample_440.xml
synapse/trunk/java/repository/conf/sample/synapse_sample_441.xml
Modified:
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/mediators.xml
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples.xml
synapse/trunk/java/modules/integration/src/test/resources/extras/synapse_sample_161.xml
Modified: synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/mediators.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/mediators.xml?rev=1746934&r1=1746933&r2=1746934&view=diff
==============================================================================
--- synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/mediators.xml (original)
+++ synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/mediators.xml Sun Jun 5 17:04:08 2016
@@ -20,6 +20,7 @@
<li><a href="#Log">Log Mediator</a></li>
<li><a href="#Property">Property Mediator</a></li>
<li><a href="#Send">Send Mediator</a></li>
+ <li><a href="#Respond">Respond Mediator</a></li>
</ul>
</li>
<li>
@@ -303,6 +304,13 @@
is making blocking service calls.
</p>
</subsection>
+ <subsection name="Respond Mediator" id="Respond">
+ <p>
+ The Respond Mediator stops the processing on the current message flow and sends
+ the message back to the client as a response.
+ </p>
+ <div class="xmlConf"><respond/></div>
+ </subsection>
</section>
<section name="Filter Mediators" id="FilterMediators">
<subsection name="Filter Mediator" id="Filter">
@@ -1145,4 +1153,4 @@
</subsection>
</section>
</body>
-</document>
\ No newline at end of file
+</document>
Modified: synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples.xml?rev=1746934&r1=1746933&r2=1746934&view=diff
==============================================================================
--- synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples.xml (original)
+++ synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples.xml Sun Jun 5 17:04:08 2016
@@ -202,6 +202,14 @@
<li><a href="samples/sample434.html">Sample 434: Callout Mediator - Invoke a service using an inline Endpoint</a></li>
</ul>
</p>
+ <h4>Respond Mediator</h4>
+ <p>
+ <ul>
+ <li><a href="samples/sample440.html">Sample 440: Respond Mediator - Echo Service with a Proxy service</a></li>
+ <li><a href="samples/sample441.html">Sample 441: Respond Mediator - Mock Service with a Proxy service</a></li>
+
+ </ul>
+ </p>
<h4>URL Rewrite Mediator</h4>
<p>
<ul>
Added: synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample440.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample440.xml?rev=1746934&view=auto
==============================================================================
--- synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample440.xml (added)
+++ synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample440.xml Sun Jun 5 17:04:08 2016
@@ -0,0 +1,64 @@
+<?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 440</title>
+ </properties>
+ <body>
+ <section name="Sample 440: Respond Mediator - Echo Service with a Proxy Service">
+ <div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+ <proxy name="EchoService">
+ <target>
+ <inSequence>
+ <respond/>
+ </inSequence>
+ </target>
+ </proxy>
+</definitions></div>
+ <subsection name="Objective">
+ <p>
+ Demonstrate how to use respond mediator to create a simple echo service
+ </p>
+ </subsection>
+ <subsection name="Pre-requisites">
+ <p>
+ <ul>
+ <li>
+ Start Synapse using the configuration numbered 440 (repository/conf/sample/synapse_sample_440.xml)
+ <div class="command">
+ Unix/Linux: sh synapse.sh -sample 440<br/>
+ Windows: synapse.bat -sample 440
+ </div>
+ </li>
+ </ul>
+ </p>
+ </subsection>
+ <subsection name="Executing the Client">
+ <p>
+ Invoke the EchoService proxy service with a payload.
+ Following is how we can use curl as the client.
+ </p>
+ <div class="command">curl -v -X POST -H "Content-type: application/xml" -d '<test>foo</test>' 'http://localhost:8280/services/EchoService'</div>
+ </subsection>
+ </section>
+ <p><a href="../samples.html">Back to Catalog</a></p>
+ </body>
+</document>
\ No newline at end of file
Added: synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample441.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample441.xml?rev=1746934&view=auto
==============================================================================
--- synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample441.xml (added)
+++ synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample441.xml Sun Jun 5 17:04:08 2016
@@ -0,0 +1,81 @@
+<?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 441</title>
+ </properties>
+ <body>
+ <section name="Sample 441: Respond Mediator - Mock a service with a proxy service">
+ <div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse">
+ <proxy name="MockService">
+ <target>
+ <inSequence>
+ <log level="full"/>
+ <payloadFactory>
+ <format>
+ <m:Sample xmlns:m="http://services.samples">
+ <m:Response>
+ <m:value>foo</m:value>
+ </m:Response>
+ </m:Sample>
+ </format>
+ <args/>
+ </payloadFactory>
+ <respond/>
+ </inSequence>
+ </target>
+ </proxy>
+</definitions></div>
+ <subsection name="Objective">
+ <p>
+ Demonstrate how to create a simple mock service with a proxy service using the respond mediator.
+ </p>
+ </subsection>
+ <subsection name="Pre-requisites">
+ <p>
+ <ul>
+ <li>
+ Start Synapse using the configuration number 441
+ (repository/conf/sample/synapse_sample_441.ml)
+ <div class="command">
+ Unix/Linux: sh synapse.sh -sample 441
+ <br/>
+ Windows: synapse.bat -sample 441
+ </div>
+ </li>
+ </ul>
+ </p>
+ </subsection>
+ <subsection name="Executing the Client">
+ <p>
+ Invoke the MockService proxy service with a payload.
+ Following is how we can use curl as the client
+ </p>
+ <div class="command">curl -v -X POST -H "Content-type: application/xml" -d '<request>foo</request>'
+ 'http://localhost:8280/services/MockService'
+ </div>
+ </subsection>
+ </section>
+ <p>
+ <a href="../samples.html">Back to Catalog</a>
+ </p>
+ </body>
+</document>
\ No newline at end of file
Modified: synapse/trunk/java/modules/integration/src/test/resources/extras/synapse_sample_161.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/resources/extras/synapse_sample_161.xml?rev=1746934&r1=1746933&r2=1746934&view=diff
==============================================================================
--- synapse/trunk/java/modules/integration/src/test/resources/extras/synapse_sample_161.xml (original)
+++ synapse/trunk/java/modules/integration/src/test/resources/extras/synapse_sample_161.xml Sun Jun 5 17:04:08 2016
@@ -18,7 +18,7 @@
~ under the License.
-->
-<!-- Repond Mediator with proxy services -->
+<!-- Respond Mediator with proxy services -->
<definitions xmlns="http://ws.apache.org/ns/synapse">
<proxy name="EchoService">
<target>
Added: synapse/trunk/java/repository/conf/sample/synapse_sample_440.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/java/repository/conf/sample/synapse_sample_440.xml?rev=1746934&view=auto
==============================================================================
--- synapse/trunk/java/repository/conf/sample/synapse_sample_440.xml (added)
+++ synapse/trunk/java/repository/conf/sample/synapse_sample_440.xml Sun Jun 5 17:04:08 2016
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<!-- Respond Mediator with proxy services -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+ <proxy name="EchoService">
+ <target>
+ <inSequence>
+ <respond/>
+ </inSequence>
+ </target>
+ </proxy>
+</definitions>
Added: synapse/trunk/java/repository/conf/sample/synapse_sample_441.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/java/repository/conf/sample/synapse_sample_441.xml?rev=1746934&view=auto
==============================================================================
--- synapse/trunk/java/repository/conf/sample/synapse_sample_441.xml (added)
+++ synapse/trunk/java/repository/conf/sample/synapse_sample_441.xml Sun Jun 5 17:04:08 2016
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<!-- Mock Service using Respond Mediator with proxy services -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+ <proxy name="MockService">
+ <target>
+ <inSequence>
+ <log level="full"/>
+ <payloadFactory>
+ <format>
+ <m:Sample xmlns:m="http://services.samples">
+ <m:Response>
+ <m:value>foo</m:value>
+ </m:Response>
+ </m:Sample>
+ </format>
+ <args>
+ </args>
+ </payloadFactory>
+ <respond/>
+ </inSequence>
+ </target>
+ </proxy>
+</definitions>