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

svn commit: r916647 - in /synapse/trunk/java/repository/conf: axis2.xml sample/resources/priority/ sample/resources/priority/priority-configuration.xml sample/synapse_sample_650.xml

Author: ruwan
Date: Fri Feb 26 11:19:19 2010
New Revision: 916647

URL: http://svn.apache.org/viewvc?rev=916647&view=rev
Log:
Adding priority based mediation samples

Added:
    synapse/trunk/java/repository/conf/sample/resources/priority/
    synapse/trunk/java/repository/conf/sample/resources/priority/priority-configuration.xml
    synapse/trunk/java/repository/conf/sample/synapse_sample_650.xml
Modified:
    synapse/trunk/java/repository/conf/axis2.xml

Modified: synapse/trunk/java/repository/conf/axis2.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/java/repository/conf/axis2.xml?rev=916647&r1=916646&r2=916647&view=diff
==============================================================================
--- synapse/trunk/java/repository/conf/axis2.xml (original)
+++ synapse/trunk/java/repository/conf/axis2.xml Fri Feb 26 11:19:19 2010
@@ -164,6 +164,7 @@
     	<parameter name="non-blocking">true</parameter>
         <!--parameter name="bind-address" locked="false">hostname or IP address</parameter-->
         <!--parameter name="WSDLEPRPrefix" locked="false">https://apachehost:port/somepath</parameter-->
+        <!-- paramter name="priorityConfigFile" locked="false">location of priority configuration file<parameter-->
     </transportReceiver>
 
     <!-- the non blocking https transport based on HttpCore + SSL-NIO extensions -->

Added: synapse/trunk/java/repository/conf/sample/resources/priority/priority-configuration.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/java/repository/conf/sample/resources/priority/priority-configuration.xml?rev=916647&view=auto
==============================================================================
--- synapse/trunk/java/repository/conf/sample/resources/priority/priority-configuration.xml (added)
+++ synapse/trunk/java/repository/conf/sample/resources/priority/priority-configuration.xml Fri Feb 26 11:19:19 2010
@@ -0,0 +1,41 @@
+<!--
+  ~  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.
+  -->
+        
+<priorityConfiguration>
+    <priority-executor>
+        <!-- two priorities specified with priority 10 and 1. Both priority messages has a queue depth of 100 -->
+        <queues isFixedCapacity="true" nextQueue="org.apache.synapse.commons.executors.PRRNextQueueAlgorithm">
+            <queue size="100" priority="10"/>
+            <queue size="100" priority="1"/>
+        </queues>
+        <!-- these are the default values, values are put here to show their availability -->
+        <threads core="20" max="100" keep-alive="5"/>
+    </priority-executor>
+
+    <!-- if a message comes that we cannot determine priority, we set a default priority of 1 -->
+    <conditions defaultPriority="1">
+        <condition priority="10">     
+            <!-- check for the header named priority --> 
+            <equal type="header" source="priority" value="5"/>        
+        </condition>
+        <condition priority="1">
+            <equal type="header" source="priority" value="1"/>
+        </condition>
+    </conditions>
+</priorityConfiguration>

Added: synapse/trunk/java/repository/conf/sample/synapse_sample_650.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/java/repository/conf/sample/synapse_sample_650.xml?rev=916647&view=auto
==============================================================================
--- synapse/trunk/java/repository/conf/sample/synapse_sample_650.xml (added)
+++ synapse/trunk/java/repository/conf/sample/synapse_sample_650.xml Fri Feb 26 11:19:19 2010
@@ -0,0 +1,54 @@
+<!--
+  ~  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.
+  -->
+
+<!-- Introduction to priority based mediation -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+    <priority-executor name="exec">
+        <queues>
+            <queue size="100" priority="1"/>
+            <queue size="100" priority="10"/>
+        </queues>
+    </priority-executor>
+    <proxy name="StockQuoteProxy">
+        <target>
+            <inSequence>
+                <filter source="$trp:priority" regex="1">
+                    <then>
+                        <enqueue priority="1" sequence="priority_sequence" executor="exec"/>
+                    </then>
+                    <else>
+                        <enqueue priority="10" sequence="priority_sequence" executor="exec"/>
+                    </else>
+                </filter>
+            </inSequence>
+            <outSequence>
+                <send/>
+            </outSequence>
+        </target>
+        <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
+    </proxy>
+    <sequence name="priority_sequence">
+        <log level="full"/>
+        <send>
+            <endpoint>
+                <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
+            </endpoint>
+        </send>
+    </sequence>
+</definitions>