synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r387760 [4/4] - in /incubator/synapse/trunk/scratch/infravio: Mediators-NoSynapseObject/ Mediators-NoSynapseObject/org/ Mediators-NoSynapseObject/org/apache/ Mediators-NoSynapseObject/org/apache/synapse/ Mediators-NoSynapseObject/org/apache...
Date Wed, 22 Mar 2006 06:54:23 GMT
Added: incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/failover_mediator/README.txt
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/failover_mediator/README.txt?rev=387760&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/failover_mediator/README.txt
(added)
+++ incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/failover_mediator/README.txt
Tue Mar 21 22:54:17 2006
@@ -0,0 +1,36 @@
+Hi everybody,
+
+Note
+-----
+
+Failover is the act of switching to a secondary service in case the primary service fails.
+Hence, logically, we can configure failover only when we have 2 or more endpoints providing
similar
+service.
+
+The failover process can be initiated on timeout and or faults.
+
+In case of 'failover on faults' the FailoverMediator keeps switching to secondary services,
+until all the secondary services are tried or one of them returns a successful result.
+
+In case failover based on timeout is active, the participating end-points would be given

+timeout values and the connection would be forced to close and a fault would be returned
if no 
+response arrives within that many milliseconds and then 'failover on fault' logic kicks in.
+
+
+Return Values
+--------------
+
+False - This would be the last mediator in the chain, like a send mediator.
+The logs provide more information in case of an error.
+
+Running Failover Mediator Sample
+===================================
+
+1. Copy synapse.xml in this repository to synapse_repository in the binary distribution.
+2. Place the FailoverMediator.aar in the synape_repository/services.
+3. Using the Ant command "ant synapse", start the stand-alone synapse server. 
+   This will start at port 8080. 
+4. Use Ant command "ant" StockQuoteClient available in this folder to run the sample. 
+ 
+The configuration is available in failover.xml, which is located in FailoverMediator.aar's

+META-INF folder. 
\ No newline at end of file

Added: incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/failover_mediator/build.xml
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/failover_mediator/build.xml?rev=387760&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/failover_mediator/build.xml
(added)
+++ incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/failover_mediator/build.xml
Tue Mar 21 22:54:17 2006
@@ -0,0 +1,79 @@
+<project name="samples" default="help">
+    <target name="help">
+        <echo>
+            This script requires Ant 1.5 or higher
+
+            usage:
+            ant -help display ant help screen
+            ant help display this message
+            ant clean delete the built directory
+
+            ant compile build the deprecation_mediator sample
+
+            ant StockQuote [Symbol] [webserviceurl] [synapseurl] {optional[repository]}
+            Use the smart client - Synapse in WS-Addressing router mode
+
+            ant synapse
+                -Dport  
+                    The port on which Synapse should listen, as provided in the synapseurl.
+                    Default is 8080.
+        </echo>
+    </target>
+
+    <property name="symbol" value="IBM"/>
+    <property name="url" value="http://somehost:8080/failoverService"/>
+    <property name="synapseurl" value="http://localhost:8080"/>
+    <property name="repository" value="../../synapse_repository"/>
+
+    <property name="class.dir" value="target/classes"/>
+
+    <path id="axis.classpath">
+        <fileset dir="../../lib">
+            <include name="*.jar"/>
+        </fileset>
+    </path>
+
+    <target name="clean">
+        <delete dir="target" quiet="true"/>
+        <delete dir="${class.dir}" quiet="true"/>
+    </target>
+
+
+    <target name="StockQuote" depends="compile">
+        <java classname="samples.userguide.StockQuoteClient"
+              classpathref="axis.classpath" fork="true">
+            <arg value="${symbol}"/>
+            <arg value="${url}"/>
+            <arg value="${synapseurl}"/>
+            <arg value="${repository}"/>
+        </java>
+    </target>
+
+    <target name="init">
+        <mkdir dir="${class.dir}"/>
+        <mkdir dir="src/ddl"/>
+
+        <path id="javac.classpath">
+            <pathelement path="${class.dir}"/>
+            <fileset dir="../../lib">
+                <include name="**/*.jar"/>
+            </fileset>
+        </path>
+    </target>
+
+    <target name="compile" depends="init" description="Compile all Java">
+        <javac srcdir="src" destdir="${class.dir}">
+            <classpath refid="javac.classpath"/>
+        </javac>
+    </target>
+
+    <target name="synapse">
+        <property name="port" value="8080"/>
+        <java classname="org.apache.axis2.transport.http.SimpleHTTPServer"
+              classpathref="axis.classpath" fork="true">
+            <arg value="../../synapse_repository"/>
+            <arg value="-p${port}"/>
+        </java>
+    </target>
+
+</project>

Added: incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/failover_mediator/synapse.xml
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/failover_mediator/synapse.xml?rev=387760&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/failover_mediator/synapse.xml
(added)
+++ incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/failover_mediator/synapse.xml
Tue Mar 21 22:54:17 2006
@@ -0,0 +1,50 @@
+<synapse xmlns="http://ws.apache.org/ns/synapse">
+
+        <engage-addressing-in/>
+        <log/>
+
+
+        <!-- this matches the gateway case -->
+        <regex message-address="to" pattern="/StockQuote.*">
+            <ref ref="stockquote"/>
+        </regex>
+        <!-- this matches the virtual url case for either the proxy or ws-add case -->
+        <regex message-address="to" pattern="http://stockquote.*">
+            <ref ref="stockquote"/>
+        </regex>
+
+
+        <regex message-address="to" pattern="http://somehost:8080/failoverService">
+<!--            <servicemediator name="Deprecation" service="DeprecationMediator"/>
-->
+            <servicemediator name="Failover" service="FailoverMediator">
+              <ParameterObject>
+                <SynapseObject name="service1">
+                    <Attribute name="url" type="STRING">http://www.webservicex.net/stockquote.asmx</Attribute>
+                    <Attribute name="active" type="BOOLEAN">true</Attribute>
+                    <Attribute name="timeout" type="LONG">10000</Attribute>
+                </SynapseObject>
+              </ParameterObject>
+            </servicemediator>
+            <classmediator name="Management" class="org.apache.synapse.mediators.resource.ResourceMediator">
+                <ParameterObject>
+                    <SynapseObject name="consumer0">
+                        <Attribute name="identifier" type="STRING">someID</Attribute>
+                        <Attribute name="priority" type="INTEGER">2</Attribute>
+                    </SynapseObject>
+                </ParameterObject>
+            </classmediator>
+        </regex>
+
+<!--        <send/>-->
+
+    <!-- these are only called if referenced above-->
+    <never>
+        <stage name="stockquote">
+            <header type="to" value="http://www.webservicex.net/stockquote.asmx" />
+            <xpath expr="//*[wsx:symbol='MSFT']" xmlns:wsx="http://www.webserviceX.NET/">
+                <fault/>
+            </xpath>
+        </stage>
+    </never>
+</synapse>
+

Added: incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/loadbalancing_mediator/README.txt
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/loadbalancing_mediator/README.txt?rev=387760&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/loadbalancing_mediator/README.txt
(added)
+++ incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/loadbalancing_mediator/README.txt
Tue Mar 21 22:54:17 2006
@@ -0,0 +1,33 @@
+Hi everybody,
+
+Note
+-----
+
+Loadbalancing is the act of distributing the load, the requests for a particular service
across 
+various service endpoints.
+In case a provider has more than one endpoint that provides the same service, he would like
the
+load of requests being made to be distributed across them.
+The meta-data for the loadbalancing mediator, is configured in the loadbalancing.xml.
+The strategy being supported now is round robin i.e. requests would be sent to the various
participating
+services in a round-robin, one after the another, fashion.
+In case the service that was invoked fails to respond, the mediator switches to the next
one in the line.
+Its a mere pass, hence the next request will get directed to the one which was supposed to
handle it if 
+the previous service had not failed.
+
+
+Return Values
+--------------
+False - Its the last mediator in the chain..A send mediator that send the request and gets
the response.
+The logs provide more information in case of an error.
+
+Running Loadbalancing Mediator Sample
+=======================================
+
+1. Copy synapse.xml in this repository to synapse_repository in the binary distribution.
+2. Place the LoadBalancingMediator.aar in the synape_repository/services.
+3. Using the Ant command "ant synapse", start the stand-alone synapse server. 
+   This will start at port 8080. 
+4. Use Ant command "ant" StockQuoteClient available in this folder to run the sample. 
+ 
+The configuration is available in loadbalancing.xml, which is located in LoadBalancingMediator.aar's

+META-INF folder. 
\ No newline at end of file

Added: incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/loadbalancing_mediator/build.xml
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/loadbalancing_mediator/build.xml?rev=387760&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/loadbalancing_mediator/build.xml
(added)
+++ incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/loadbalancing_mediator/build.xml
Tue Mar 21 22:54:17 2006
@@ -0,0 +1,79 @@
+<project name="samples" default="help">
+    <target name="help">
+        <echo>
+            This script requires Ant 1.5 or higher
+
+            usage:
+            ant -help display ant help screen
+            ant help display this message
+            ant clean delete the built directory
+
+            ant compile build the deprecation_mediator sample
+
+            ant StockQuote [Symbol] [webserviceurl] [synapseurl] {optional[repository]}
+            Use the smart client - Synapse in WS-Addressing router mode
+
+            ant synapse
+                -Dport  
+                    The port on which Synapse should listen, as provided in the synapseurl.
+                    Default is 8080.
+        </echo>
+    </target>
+
+    <property name="symbol" value="IBM"/>
+    <property name="url" value="http://localhost:8080/loadBalancingService"/>
+    <property name="synapseurl" value="http://localhost:8080"/>
+    <property name="repository" value="../../synapse_repository"/>
+
+    <property name="class.dir" value="target/classes"/>
+
+    <path id="axis.classpath">
+        <fileset dir="../../lib">
+            <include name="*.jar"/>
+        </fileset>
+    </path>
+
+    <target name="clean">
+        <delete dir="target" quiet="true"/>
+        <delete dir="${class.dir}" quiet="true"/>
+    </target>
+
+
+    <target name="StockQuote" depends="compile">
+        <java classname="samples.userguide.StockQuoteClient"
+              classpathref="axis.classpath" fork="true">
+            <arg value="${symbol}"/>
+            <arg value="${url}"/>
+            <arg value="${synapseurl}"/>
+            <arg value="${repository}"/>
+        </java>
+    </target>
+
+    <target name="init">
+        <mkdir dir="${class.dir}"/>
+        <mkdir dir="src/ddl"/>
+
+        <path id="javac.classpath">
+            <pathelement path="${class.dir}"/>
+            <fileset dir="../../lib">
+                <include name="**/*.jar"/>
+            </fileset>
+        </path>
+    </target>
+
+    <target name="compile" depends="init" description="Compile all Java">
+        <javac srcdir="src" destdir="${class.dir}">
+            <classpath refid="javac.classpath"/>
+        </javac>
+    </target>
+
+    <target name="synapse">
+        <property name="port" value="8080"/>
+        <java classname="org.apache.axis2.transport.http.SimpleHTTPServer"
+              classpathref="axis.classpath" fork="true">
+            <arg value="../../synapse_repository"/>
+            <arg value="-p${port}"/>
+        </java>
+    </target>
+
+</project>

Added: incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/loadbalancing_mediator/synapse.xml
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/loadbalancing_mediator/synapse.xml?rev=387760&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/loadbalancing_mediator/synapse.xml
(added)
+++ incubator/synapse/trunk/scratch/infravio/Mediators-SynapseObject/scripts/loadbalancing_mediator/synapse.xml
Tue Mar 21 22:54:17 2006
@@ -0,0 +1,33 @@
+<synapse xmlns="http://ws.apache.org/ns/synapse">
+
+        <engage-addressing-in/>
+        <log/>
+
+
+        <!-- this matches the gateway case -->
+        <regex message-address="to" pattern="/StockQuote.*">
+            <ref ref="stockquote"/>
+        </regex>
+        <!-- this matches the virtual url case for either the proxy or ws-add case -->
+        <regex message-address="to" pattern="http://stockquote.*">
+            <ref ref="stockquote"/>
+        </regex>
+
+
+        <regex message-address="to" pattern="http://localhost:8080/loadBalancingService">
+            <servicemediator name="loadbalancing" service="LoadBalancingMediator"/>
+        </regex>
+
+         <send/>
+
+    <!-- these are only called if referenced above-->
+    <never>
+        <stage name="stockquote">
+            <header type="to" value="http://www.webservicex.net/stockquote.asmx" />
+            <xpath expr="//*[wsx:symbol='MSFT']" xmlns:wsx="http://www.webserviceX.NET/">
+                <fault/>
+            </xpath>
+        </stage>
+    </never>
+</synapse>
+



---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


Mime
View raw message