You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by ve...@apache.org on 2008/11/07 02:58:35 UTC

svn commit: r712037 - in /synapse/trunk/java: repository/conf/sample/synapse_sample_250.xml repository/conf/sample/synapse_sample_252.xml src/site/xdoc/Synapse_Samples.xml

Author: veithen
Date: Thu Nov  6 17:58:35 2008
New Revision: 712037

URL: http://svn.apache.org/viewvc?rev=712037&view=rev
Log:
Updated samples to show JMS content type rules introduced in r712036 (see also SYNAPSE-424).

Modified:
    synapse/trunk/java/repository/conf/sample/synapse_sample_250.xml
    synapse/trunk/java/repository/conf/sample/synapse_sample_252.xml
    synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml

Modified: synapse/trunk/java/repository/conf/sample/synapse_sample_250.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/java/repository/conf/sample/synapse_sample_250.xml?rev=712037&r1=712036&r2=712037&view=diff
==============================================================================
--- synapse/trunk/java/repository/conf/sample/synapse_sample_250.xml (original)
+++ synapse/trunk/java/repository/conf/sample/synapse_sample_250.xml Thu Nov  6 17:58:35 2008
@@ -33,7 +33,12 @@
             </outSequence>
         </target>
         <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
-        <parameter name="transport.jms.ContentType">application/xml</parameter>
+        <parameter name="transport.jms.ContentType">
+            <rules>
+                <jmsProperty>contentType</jmsProperty>
+                <default>application/xml</default>
+            </rules>
+        </parameter>
     </proxy>
 
 </definitions>
\ No newline at end of file

Modified: synapse/trunk/java/repository/conf/sample/synapse_sample_252.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/java/repository/conf/sample/synapse_sample_252.xml?rev=712037&r1=712036&r2=712037&view=diff
==============================================================================
--- synapse/trunk/java/repository/conf/sample/synapse_sample_252.xml (original)
+++ synapse/trunk/java/repository/conf/sample/synapse_sample_252.xml Thu Nov  6 17:58:35 2008
@@ -70,10 +70,20 @@
 
     <proxy name="JMSFileUploadProxy" transports="jms">
         <target inSequence="mtom_proxy" outSequence="out"/>
+        <parameter name="transport.jms.ContentType">
+            <rules>
+                <bytesMessage>application/octet-stream</bytesMessage>
+            </rules>
+        </parameter>
         <parameter name="Wrapper">{http://services.samples/xsd}element</parameter>
     </proxy>
     <proxy name="JMSTextProxy" transports="jms">
         <target inSequence="text_proxy" outSequence="out"/>
+        <parameter name="transport.jms.ContentType">
+            <rules>
+                <textMessage>text/plain</textMessage>
+            </rules>
+        </parameter>
         <parameter name="Wrapper">{http://services.samples/xsd}text</parameter>
     </proxy>
     <proxy name="JMSPoxProxy" transports="jms">

Modified: synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml?rev=712037&r1=712036&r2=712037&view=diff
==============================================================================
--- synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml (original)
+++ synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml Thu Nov  6 17:58:35 2008
@@ -2005,7 +2005,12 @@
             </outSequence>
         </target>
         <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
-        <parameter name="transport.jms.ContentType">application/xml</parameter>
+        <parameter name="transport.jms.ContentType">
+            <rules>
+                <jmsProperty>contentType</jmsProperty>
+                <default>application/xml</default>
+            </rules>
+        </parameter>
     </proxy>
 
 </definitions>]]></pre>
@@ -2029,8 +2034,10 @@
 <p>Now if you examine the console running the sample Axis2 server, you will see a message indicating that the server has accepted an order as follows: </p>
 <pre xml:space="preserve">Accepted order for : 16517 stocks of MSFT at $ 169.14622538721846</pre>
 <p>In this sample, the client sends the request message to the proxy service exposed over JMS in Synsape. Synapse forwards this message to the HTTP EPR of the simple stock quote service hosted on the sample Axis2 server.
-Note that the operation is out-only and no response is sent back to the client. The transport.jms.ContentType property is necessary because the JMS client doesn't send a Content-Type header.
-The value 'application/xml' indicates to the JMS transport to expect POX messages.</p>
+Note that the operation is out-only and no response is sent back to the client. The transport.jms.ContentType property
+is necessary to allow the JMS transport to determine the content type of incoming messages. With the given configuration
+it will first try to read the content type from the 'contentType' message property and fall back to 'application/xml'
+(i.e. POX) if this property is not set. Note that the JMS client used in this example doesn't send any content type information.</p>
 <p>Note: It is possible to instruct a JMS proxy service to listen to an already existing destination without creating a new one. To do this, use the property elements on the proxy service definition to specify the destination and connection factory etc. </p>
 <p>e.g. </p>
 <pre xml:space="preserve">&lt;property name=&quot;transport.jms.Destination&quot; value=&quot;dynamicTopics/something.TestTopic&quot;/&gt;</pre>
@@ -2127,10 +2134,20 @@
 
     <proxy name="JMSFileUploadProxy" transports="jms">
         <target inSequence="mtom_proxy" outSequence="out"/>
+        <parameter name="transport.jms.ContentType">
+            <rules>
+                <bytesMessage>application/octet-stream</bytesMessage>
+            </rules>
+        </parameter>
         <parameter name="Wrapper">{http://services.samples/xsd}element</parameter>
     </proxy>
     <proxy name="JMSTextProxy" transports="jms">
         <target inSequence="text_proxy" outSequence="out"/>
+        <parameter name="transport.jms.ContentType">
+            <rules>
+                <textMessage>text/plain</textMessage>
+            </rules>
+        </parameter>
         <parameter name="Wrapper">{http://services.samples/xsd}text</parameter>
     </proxy>
     <proxy name="JMSPoxProxy" transports="jms">