Modified:
plugins/synapse/esper/trunk/java/src/site/xdoc/SCI-Flex_Samples.xml
Log:
Fixing formatting of SCI-Flex Samples documentation
Modified:
plugins/synapse/esper/trunk/java/src/site/xdoc/SCI-Flex_Samples.xml
==============================================================================
--- plugins/synapse/esper/trunk/java/src/site/xdoc/SCI-Flex_Samples.xml
(original)
+++ plugins/synapse/esper/trunk/java/src/site/xdoc/SCI-Flex_Samples.xml Fri
Nov 21 00:54:25 2008
@@ -102,159 +102,114 @@
}</style>
</head>
<body>
- <div style="margin-top:-40px; float:right; _margin-top:0px;">
- <img alt="SCI-Flex logo"
- src="images/sciflex-logo-web2.png" width="197"
- height="82"/>
- </div>
- <div>
- <h1>
+ <div style="margin-top:-40px; float:right; _margin-top:0px;
margin-right:-80px;">
+ <img alt="SCI-Flex Logo"
+ src="images/SCIFlex_Logo.png" width="369"
+ height="90"/>
+ </div>
+ <div><h1>
Project SCI-Flex - Running the Samples
- </h1>
- </div>
- <p>
+ </h1></div><p>
This document serves as the starting point for anyone who wishes to
gain a
better understanding on how to run the samples included as a part of
this
product. These samples are intended to cover a great deal of basic
functionality and capabilities that SCI-Flex adds to
- <a href="http://synapse.apache.org">Apache Synapse ESB</a>, or any
derived
- product based on Apache Synapse (ex:- <a
href="http://wso2.org/project/esb">
+ <a href="http://synapse.apache.org" class="externalLink">Apache
Synapse ESB</a>, or any derived
+ product based on Apache Synapse (ex:- <a
href="http://wso2.org/project/esb" class="externalLink">
WSO2 ESB</a>). For more information and detailed help and support,
please
feel free to discuss your problem on our <a
href="mail-lists.html">mailing
lists</a>.</p>
- <h2>
- <a name="TOC" id="TOC">Contents</a>
- </h2>
- <div class="section-content">
- <ul>
- <li>
- <a href="sciflex_samples_setup.html#Overview">Overview</a>
- </li>
- <li>
- <a href="#XMLMediator">XML Mediator Samples</a>
- <ul>
- <li>
- <a href="#Sample0">Sample 0: Introduction to XML Mediator</a>
- </li>
- <li>
- <a href="#Sample1">Sample 1: XML Mediator with ESB Registry
- Support</a>
- </li>
- <li>
- <a href="#Sample2">Sample 2: XML Mediator using EPL Statement
- stored as XML on Registry</a>
- </li>
- <li>
- <a href="#Sample3">Sample 3: XML Mediator using EPL Statement
- and Endpoint stored on Registry</a>
- </li>
- <li>
- <a href="#Sample4">Sample 4: XML Mediator listening to
Multiple
- Event Sources</a>
- </li>
- </ul>
- </li>
- <li>
- <a href="#AxiomMediator">Axiom Mediator Samples</a>
- <ul>
- <li>
- <a href="#Sample50">Sample 50: Introduction to Axiom
Mediator</a>
- </li>
- <li>
- <a href="#Sample51">Sample 51: Axiom Mediator with ESB
Registry
- Support</a>
- </li>
- <li>
- <a href="#Sample52">Sample 52: Axiom Mediator using EPL
Statement
- stored as XML on Registry</a>
- </li>
- <li>
- <a href="#Sample53">Sample 53: Axiom Mediator using EPL
Statement
- and Endpoint stored on Registry</a>
- </li>
- <li>
- <a href="#Sample54">Sample 54: Axiom Mediator with WSO2
Registry
- Support</a>
- </li>
- <li>
- <a href="#Sample55">Sample 55: Multiple Mediator Sample,
using XML
- Mediator and Axiom Mediator</a>
- </li>
- </ul>
- </li>
- </ul>
- <h1>
- <a name="XMLMediator" id="XMLMediator">XML Mediator Samples</a>
- </h1>
- <h2>
- <a name="Sample0" id="Sample0">Sample 0: Introduction to XML
Mediator</a>
- </h2>
-<pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
- <in>
- <filter source="get-property('To')"
regex="http://localhost:9000/soap/SimpleStockQuoteService">
- <class
name="org.sciflex.plugins.synapse.esper.mediators.XMLMediator">
- <property name="Configuration">
+<h3><a name="TOC"></a>Contents</h3><div class="section-content"><ul><li><a
href="SCI-Flex_Starting.html">Overview</a></li>
+<li><a href="#XMLMediator">XML Mediator Samples</a><ul><li><a
href="#Sample0">Sample 0: Introduction to XML Mediator</a></li>
+<li><a href="#Sample1">Sample 1: XML Mediator with ESB Registry
+ Support</a></li>
+<li><a href="#Sample2">Sample 2: XML Mediator using EPL Statement
+ stored as XML on Registry</a></li>
+<li><a href="#Sample3">Sample 3: XML Mediator using EPL Statement
+ and Endpoint stored on Registry</a></li>
+<li><a href="#Sample4">Sample 4: XML Mediator listening to Multiple
+ Event Sources</a></li>
+</ul>
+</li>
+<li><a href="#AxiomMediator">Axiom Mediator Samples</a><ul><li><a
href="#Sample50">Sample 50: Introduction to Axiom Mediator</a></li>
+<li><a href="#Sample51">Sample 51: Axiom Mediator with ESB Registry
+ Support</a></li>
+<li><a href="#Sample52">Sample 52: Axiom Mediator using EPL Statement
+ stored as XML on Registry</a></li>
+<li><a href="#Sample53">Sample 53: Axiom Mediator using EPL Statement
+ and Endpoint stored on Registry</a></li>
+<li><a href="#Sample54">Sample 54: Axiom Mediator with WSO2 Registry
+ Support</a></li>
+<li><a href="#Sample55">Sample 55: Multiple Mediator Sample, using XML
+ Mediator and Axiom Mediator</a></li>
+</ul>
+</li>
+</ul>
+<h1><a name="XMLMediator"></a>XML Mediator Samples
+ </h1><h2><a name="Sample0"></a>Sample 0: Introduction to XML Mediator
+ </h2><pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
+ <in>
+ <filter source="get-property('To')"
regex="http://localhost:9000/soap/SimpleStockQuoteService">
+ <class
name="org.sciflex.plugins.synapse.esper.mediators.XMLMediator">
+ <property name="Configuration">
<esper-configuration>
- <event-type alias="XMLEvent">
- <xml-dom root-element-name="getQuote"
default-namespace="http://services.samples/xsd">
- <namespace-prefix prefix="m0"
namespace="http://services.samples/xsd"/>
- <xpath-property property-name="symbol"
xpath="//m0:getQuote/m0:request/m0:symbol" type="string"/>
+ <event-type alias="XMLEvent">
+ <xml-dom
root-element-name="getQuote"
+
default-namespace="http://services.samples/xsd">
+ <namespace-prefix prefix="m0"
namespace="http://services.samples/xsd"/>
+ <xpath-property
property-name="symbol"
+
xpath="//m0:getQuote/m0:request/m0:symbol"
type="string"/>
</xml-dom>
</event-type>
</esper-configuration>
</property>
- <property name="Statement" value="select symbol from
XMLEvent"/>
- <property name="EventToAddress"
value="http://localhost:9999/soap/EventListener"/>
+ <property name="Statement" value="select
symbol from XMLEvent"/>
+ <property name="EventToAddress"
value="http://localhost:9999/soap/EventListener"/>
</class>
</filter>
- <filter source="get-property('To')"
regex="http://localhost:9999/soap/EventListener">
- <log level="full"/>
+ <filter source="get-property('To')"
regex="http://localhost:9999/soap/EventListener">
+ <log level="full"/>
</filter>
</in>
- <switch source="get-property('To')">
- <case regex="http://localhost:9999/soap/EventListener"/>
+ <switch source="get-property('To')">
+ <case
regex="http://localhost:9999/soap/EventListener"/>
<default>
<send/>
</default>
</switch>
-</definitions></pre>
- <p>
- <strong>Objective: This sample serves as an introduction to the XML
+</definitions></pre><p><strong>Objective: This sample serves as an
introduction to the XML
Mediator, which is used to connect the Esper CEP engine to Apache
Synapse
ESB. This shows how a message that passes through Synapse can be
redirected to the Esper CEP which will identify desired patterns and
report to Synapse. The operation can be observed by monitoring the
response being logged. The response will be dropped at the ESB,
instead of
- being forwarded to further parties.</strong>
- </p>
- <p>
+ being forwarded to further parties.</strong></p>
+<p>
These samples make use of the Stock Quote client that comes with the
WSO2
ESB. Please note that if you are using the Synapse, you will have to
replace the address URL with <strong>
http://localhost:9000/services/SimpleStockQuoteService</strong>. The
Stock
Quote client can operate in the following modes for this example.
</p>
- <ol>
- <li>
+<ol type="1"><li>
Smart Client mode
</li>
- <pre xml:space="preserve">ant stockquote
-Daddurl=http://localhost:9000/soap/SimpleStockQuoteService
-Dtrpurl=http://localhost:8280/</pre>
- <li>
+<pre xml:space="preserve">ant stockquote
-Daddurl=http://localhost:9000/soap/SimpleStockQuoteService
+ -Dtrpurl=http://localhost:8280/</pre><li>
Using Synapse as a HTTP Proxy
</li>
- <pre xml:space="preserve">ant stockquote
-Daddurl=http://localhost:9000/soap/SimpleStockQuoteService
-Dprxurl=http://localhost:8280/</pre>
- </ol>
- <p>
- <strong>Prerequisites:<br/> </strong>Replace Synapse configuration
with
- "sciflex_sample_0.xml" (save "sciflex_sample_0.xml" as
- "webapp/WEB-INF/classes/conf/synapse.xml").
- <br/> Start the Axis2 server and deploy the SimpleStockQuoteService
if
+<pre xml:space="preserve">ant stockquote
-Daddurl=http://localhost:9000/soap/SimpleStockQuoteService
+ -Dprxurl=http://localhost:8280/</pre></ol>
+<p><strong>Prerequisites:<br />
+</strong>Replace Synapse configuration with
+ "sciflex_sample_0.xml" (save
"sciflex_sample_0.xml" as
+ "webapp/WEB-INF/classes/conf/synapse.xml").
+ <br />
+ Start the Axis2 server and deploy the SimpleStockQuoteService if
not already deployed.
</p>
- <p>
- <strong>Executing the Smart Client</strong>
- </p>
- <p>
+<p><strong>Executing the Smart Client</strong></p>
+<p>
When executing the Smart Client, Synapse or the WSO2 ESB will log the
output returned by the Esper CEP (we assume that you have not
changed the
default log output level, which is INFO). If you observe the output
of the
@@ -264,383 +219,380 @@
You will see a message in the Axis2 server console confirming that
the
message got routed to the sample server and the sample service
hosted at
the sample server generating a stock quote for the requested symbol.
The
- Synapse engine logs the message at the "full" log level (i.e. all the
+ Synapse engine logs the message at the "full" log level
(i.e. all the
message headers and the body) and drops the message without
forwarding it.
</p>
-<pre xml:space="preserve">LogMediator To:
http://localhost:9999/soap/EventListener, MessageID:
urn:uuid:A3D5F70CB5E08A2ABE74778911008771-1338866042, Direction: request,
Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><ax:map
xmlns:ax="http://ws.apache.org/commons/ns/payload"><ax:entry
name="symbol"
type="string">IBM</ax:entry></ax:map></soapenv:Body></soapenv:Envelope></pre>
- <p>
+<pre xml:space="preserve">LogMediator To:
http://localhost:9999/soap/EventListener, MessageID:
+ urn:uuid:A3D5F70CB5E08A2ABE74778911008771-1338866042, Direction:
request, Envelope:
+ <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope
+
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><ax:map
+
xmlns:ax="http://ws.apache.org/commons/ns/payload"><ax:entry
name="symbol" type="string">IBM</ax:entry>
+ </ax:map></soapenv:Body></soapenv:Envelope></pre><p>
The complete mediation process can be observed by instructing the
logger
mechanism to log DEBUG output of the mediator. This can be achieved
by
adding the following line to your log4j configuration (found in
- "webapp/WEB-INF/classes/conf/log4j.properties"). The TRACE mode can
be
+ "webapp/WEB-INF/classes/conf/log4j.properties"). The TRACE
mode can be
used for better observation.
</p>
-<pre
xml:space="preserve">log4j.category.org.sciflex.plugins.synapse.esper=DEBUG</pre>
- <p>
- <strong>Executing the Proxy Client</strong>
- </p>
- <p>
+<pre
xml:space="preserve">log4j.category.org.sciflex.plugins.synapse.esper=DEBUG</pre><p><strong>Executing
the Proxy Client</strong></p>
+<p>
You will see the exact same behavior as per the previous example
when you
run this scenario. However this time the difference is at the
client, as
it sends the message to the WS-Addressing 'To' address
http://localhost:9000/soap/SimpleStockQuoteService, but the transport
specifies Synapse as the HTTP proxy.
</p>
- <h2>
- <a name="Sample1" id="Sample1">Sample 1: XML Mediator with ESB
Registry
- Support</a>
- </h2>
-<pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
- <registry provider="org.wso2.esb.registry.ESBRegistry">
- <parameter
name="root">file:repository/conf/sample/resources/</parameter>
- <parameter name="cachableDuration">15000</parameter>
+<h2><a name="Sample1"></a>Sample 1: XML Mediator with ESB
+ Registry Support
+ </h2><pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
+ <registry provider="org.wso2.esb.registry.ESBRegistry">
+ <parameter
name="root">file:repository/conf/sample/resources/</parameter>
+ <parameter
name="cachableDuration">15000</parameter>
</registry>
<in>
- <filter source="get-property('To')"
regex="http://localhost:9000/soap/SimpleStockQuoteService">
- <class
name="org.sciflex.plugins.synapse.esper.mediators.XMLMediator">
- <property name="Configuration">
+ <filter source="get-property('To')"
regex="http://localhost:9000/soap/SimpleStockQuoteService">
+ <class
name="org.sciflex.plugins.synapse.esper.mediators.XMLMediator">
+ <property name="Configuration">
<esper-configuration>
- <event-type alias="XMLEvent">
- <xml-dom root-element-name="getQuote"
default-namespace="http://services.samples/xsd">
- <namespace-prefix prefix="m0"
namespace="http://services.samples/xsd"/>
- <xpath-property property-name="symbol"
xpath="//m0:getQuote/m0:request/m0:symbol" type="string"/>
+ <event-type alias="XMLEvent">
+ <xml-dom
root-element-name="getQuote"
+
default-namespace="http://services.samples/xsd">
+ <namespace-prefix prefix="m0"
namespace="http://services.samples/xsd"/>
+ <xpath-property
property-name="symbol"
+
xpath="//m0:getQuote/m0:request/m0:symbol"
type="string"/>
</xml-dom>
</event-type>
</esper-configuration>
</property>
- <property name="Statement" value="select symbol from
XMLEvent"/>
- <property name="EventToAddress"
value="http://localhost:9999/soap/EventListener"/>
+ <property name="Statement" value="select
symbol from XMLEvent"/>
+ <property name="EventToAddress"
value="http://localhost:9999/soap/EventListener"/>
</class>
</filter>
- <filter source="get-property('To')"
regex="http://localhost:9999/soap/EventListener">
- <log level="full"/>
+ <filter source="get-property('To')"
regex="http://localhost:9999/soap/EventListener">
+ <log level="full"/>
</filter>
</in>
- <switch source="get-property('To')">
- <case regex="http://localhost:9999/soap/EventListener">
+ <switch source="get-property('To')">
+ <case
regex="http://localhost:9999/soap/EventListener">
<send>
- <endpoint key="endpoint/endpoint.xml"/>
+ <endpoint key="endpoint/endpoint.xml"/>
</send>
</case>
<default>
<send/>
</default>
</switch>
-</definitions></pre>
- <p>
- <strong>Objective: This sample shows how the XML Mediator can be
used in
+</definitions></pre><p><strong>Objective: This sample shows how the
XML Mediator can be used in
conjunction with a back-end registry. We have used the ESB Registry
in here
as an example. This sample defers from the previous in the sense that
instead of dropping the sample, the ESB forwards it to the specified
- endpoint.</strong>
- </p>
- <p>
- <strong>Prerequisites:<br/> </strong>Replace Synapse configuration
with
- "sciflex_sample_1.xml" (save "sciflex_sample_1.xml" as
- "webapp/WEB-INF/classes/conf/synapse.xml").
- <br/> Start the Axis2 server and deploy the SimpleStockQuoteService
if
+ endpoint.</strong></p>
+<p><strong>Prerequisites:<br />
+</strong>Replace Synapse configuration with
+ "sciflex_sample_1.xml" (save
"sciflex_sample_1.xml" as
+ "webapp/WEB-INF/classes/conf/synapse.xml").
+ <br />
+ Start the Axis2 server and deploy the SimpleStockQuoteService if
not already deployed.
</p>
- <p>
+<p>
In order to run this sample you will have to deploy the endpoint on
the
- ESB Registry. This can be done by copying the "endpoint" directory
found
- in "resources/registry" to the "registry" directory found inside the
ESB
+ ESB Registry. This can be done by copying the "endpoint"
directory found
+ in "resources/registry" to the "registry"
directory found inside the ESB
installation (you should see directories such as, Policy, Schema,
Scripts
in this directory).
</p>
- <p>
+<p>
The structure of the endpoint used here is the same as the ones used
in
Synapse. More information is found
- <a
href="http://synapse.apache.org/Synapse_Configuration_Language.html#endpoint">
+ <a
href="http://synapse.apache.org/Synapse_Configuration_Language.html#endpoint"
class="externalLink">
here</a>.
</p>
- <h2>
- <a name="Sample2" id="Sample2">Sample 2: XML Mediator using EPL
Statement
- stored as XML on Registry</a>
- </h2>
-<pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
- <registry provider="org.wso2.esb.registry.ESBRegistry">
- <parameter
name="root">file:repository/conf/sample/resources/</parameter>
- <parameter name="cachableDuration">15000</parameter>
+<h2><a name="Sample2"></a>Sample 2: XML Mediator using EPL
+ Statement stored as XML on Registry
+ </h2><pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
+ <registry provider="org.wso2.esb.registry.ESBRegistry">
+ <parameter
name="root">file:repository/conf/sample/resources/</parameter>
+ <parameter
name="cachableDuration">15000</parameter>
</registry>
<in>
- <filter source="get-property('To')"
regex="http://localhost:9000/soap/SimpleStockQuoteService">
- <class
name="org.sciflex.plugins.synapse.esper.mediators.XMLMediator">
- <property name="Configuration">
+ <filter source="get-property('To')"
regex="http://localhost:9000/soap/SimpleStockQuoteService">
+ <class
name="org.sciflex.plugins.synapse.esper.mediators.XMLMediator">
+ <property name="Configuration">
<esper-configuration>
- <event-type alias="XMLEvent">
- <xml-dom root-element-name="getQuote"
default-namespace="http://services.samples/xsd">
- <namespace-prefix prefix="m0"
namespace="http://services.samples/xsd"/>
- <xpath-property property-name="symbol"
xpath="//m0:getQuote/m0:request/m0:symbol" type="string"/>
+ <event-type alias="XMLEvent">
+ <xml-dom
root-element-name="getQuote"
+
default-namespace="http://services.samples/xsd">
+ <namespace-prefix prefix="m0"
namespace="http://services.samples/xsd"/>
+ <xpath-property
property-name="symbol"
+
xpath="//m0:getQuote/m0:request/m0:symbol"
type="string"/>
</xml-dom>
</event-type>
</esper-configuration>
</property>
- <property name="Statement">
- <epl-statement
key="statement/statement_xml.xml"/>
+ <property name="Statement">
+ <epl-statement
key="statement/statement_xml.xml"/>
</property>
- <property name="EventToAddress"
value="http://localhost:9999/soap/EventListener"/>
+ <property name="EventToAddress"
value="http://localhost:9999/soap/EventListener"/>
</class>
</filter>
- <filter source="get-property('To')"
regex="http://localhost:9999/soap/EventListener">
- <log level="full"/>
+ <filter source="get-property('To')"
regex="http://localhost:9999/soap/EventListener">
+ <log level="full"/>
</filter>
</in>
- <switch source="get-property('To')">
- <case regex="http://localhost:9999/soap/EventListener"/>
+ <switch source="get-property('To')">
+ <case
regex="http://localhost:9999/soap/EventListener"/>
<default>
<send/>
</default>
</switch>
-</definitions></pre>
- <p>
- <strong>Objective: This sample shows how the XML Mediator can be
used in
+</definitions></pre><p><strong>Objective: This sample shows how the
XML Mediator can be used in
conjunction with a EPL statement stored in a back-end registry. We
have
used the ESB Registry in here as an example. This sample defers from
the
sample 0, in the sense that the EPL statement is dynamically loaded
from
- the back-end registry.</strong>
- </p>
- <p>
- <strong>Prerequisites:<br/> </strong>Replace Synapse configuration
with
- "sciflex_sample_2.xml" (save "sciflex_sample_2.xml" as
- "webapp/WEB-INF/classes/conf/synapse.xml").
- <br/> Start the Axis2 server and deploy the SimpleStockQuoteService
if
+ the back-end registry.</strong></p>
+<p><strong>Prerequisites:<br />
+</strong>Replace Synapse configuration with
+ "sciflex_sample_2.xml" (save
"sciflex_sample_2.xml" as
+ "webapp/WEB-INF/classes/conf/synapse.xml").
+ <br />
+ Start the Axis2 server and deploy the SimpleStockQuoteService if
not already deployed.
</p>
- <p>
+<p>
In order to run this sample you will have to deploy the statements
on the
- ESB Registry. This can be done by copying the "statement" directory
found
- in "resources/registry" to the "registry" directory found inside the
ESB
+ ESB Registry. This can be done by copying the "statement"
directory found
+ in "resources/registry" to the "registry"
directory found inside the ESB
installation (you should see directories such as, Policy, Schema,
Scripts
in this directory).
</p>
- <p>
+<p>
The expected format of the statement in XML is as shown below. The
content
in the value attribute denotes the EPL query used.
</p>
-<pre xml:space="preserve"><epl value="select symbol from
XMLEvent"/></pre>
- <h2>
- <a name="Sample3" id="Sample3">Sample 3: XML Mediator using EPL
Statement
- and Endpoint stored on Registry</a>
- </h2>
-<pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
- <registry provider="org.wso2.esb.registry.ESBRegistry">
- <parameter
name="root">file:repository/conf/sample/resources/</parameter>
- <parameter name="cachableDuration">15000</parameter>
+<pre xml:space="preserve"><epl value="select symbol from
XMLEvent"/></pre><h2><a name="Sample3"></a>Sample 3: XML Mediator
using EPL
+ Statement and Endpoint stored on Registry
+ </h2><pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
+ <registry provider="org.wso2.esb.registry.ESBRegistry">
+ <parameter
name="root">file:repository/conf/sample/resources/</parameter>
+ <parameter
name="cachableDuration">15000</parameter>
</registry>
<in>
- <filter source="get-property('To')"
regex="http://localhost:9000/soap/SimpleStockQuoteService">
- <class
name="org.sciflex.plugins.synapse.esper.mediators.XMLMediator">
- <property name="Configuration">
+ <filter source="get-property('To')"
regex="http://localhost:9000/soap/SimpleStockQuoteService">
+ <class
name="org.sciflex.plugins.synapse.esper.mediators.XMLMediator">
+ <property name="Configuration">
<esper-configuration>
- <event-type alias="XMLEvent">
- <xml-dom root-element-name="getQuote"
default-namespace="http://services.samples/xsd">
- <namespace-prefix prefix="m0"
namespace="http://services.samples/xsd"/>
- <xpath-property property-name="symbol"
xpath="//m0:getQuote/m0:request/m0:symbol" type="string"/>
+ <event-type alias="XMLEvent">
+ <xml-dom
root-element-name="getQuote"
+
default-namespace="http://services.samples/xsd">
+ <namespace-prefix prefix="m0"
namespace="http://services.samples/xsd"/>
+ <xpath-property
property-name="symbol"
+
xpath="//m0:getQuote/m0:request/m0:symbol"
type="string"/>
</xml-dom>
</event-type>
</esper-configuration>
</property>
- <property name="Statement">
- <epl-statement
key="statement/statement_xml.epl"/>
+ <property name="Statement">
+ <epl-statement
key="statement/statement_xml.epl"/>
</property>
- <property name="EventToAddress"
value="http://localhost:9999/soap/EventListener"/>
+ <property name="EventToAddress"
value="http://localhost:9999/soap/EventListener"/>
</class>
</filter>
- <filter source="get-property('To')"
regex="http://localhost:9999/soap/EventListener">
- <log level="full"/>
+ <filter source="get-property('To')"
regex="http://localhost:9999/soap/EventListener">
+ <log level="full"/>
</filter>
</in>
- <switch source="get-property('To')">
- <case regex="http://localhost:9999/soap/EventListener">
+ <switch source="get-property('To')">
+ <case
regex="http://localhost:9999/soap/EventListener">
<send>
- <endpoint key="endpoint/endpoint.xml"/>
+ <endpoint key="endpoint/endpoint.xml"/>
</send>
</case>
<default>
<send/>
</default>
</switch>
-</definitions></pre>
- <p>
- <strong>Objective: This sample shows how the XML Mediator can be
used in
+</definitions></pre><p><strong>Objective: This sample shows how the
XML Mediator can be used in
conjunction with a EPL statement and an endpoint stored in a back-end
registry. This sample combines the samples 1, and 2 above except for
the
fact that the query is stored as a text file instead of an XML file.
- </strong>
- </p>
- <p>
- <strong>Prerequisites:<br/> </strong>Replace Synapse configuration
with
- "sciflex_sample_3.xml" (save "sciflex_sample_3.xml" as
- "webapp/WEB-INF/classes/conf/synapse.xml").
- <br/> Start the Axis2 server and deploy the SimpleStockQuoteService
if
+ </strong></p>
+<p><strong>Prerequisites:<br />
+</strong>Replace Synapse configuration with
+ "sciflex_sample_3.xml" (save
"sciflex_sample_3.xml" as
+ "webapp/WEB-INF/classes/conf/synapse.xml").
+ <br />
+ Start the Axis2 server and deploy the SimpleStockQuoteService if
not already deployed.
</p>
- <p>
+<p>
You need to deploy the statements as well as the endpoint on the
registry
to run this sample. Refer samples 1, and 2 above for more
information.
</p>
- <p>
+<p>
The format of the query stored on the registry is as shown below. We
have
used the desired *.epl extension to denote these files.
</p>
-<pre xml:space="preserve">select symbol from XMLEvent</pre>
- <h2>
- <a name="Sample4" id="Sample4">Sample 4: XML Mediator listening to
Multiple
- Event Sources</a>
- </h2>
-<pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
- <task class="org.apache.synapse.startup.tasks.MessageInjector"
name="Tick">
- <property name="to" value="http://localhost:9900/soap/Tick"/>
- <property name="soapAction"
value="http://localhost:9900/soap/Tick"/>
- <property name="message">
- <tick xmlns="http://mycom.com/ns/tick">
+<pre xml:space="preserve">select symbol from XMLEvent</pre><h2><a
name="Sample4"></a>Sample 4: XML Mediator listening to
+ Multiple Event Sources
+ </h2><pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
+ <task
class="org.apache.synapse.startup.tasks.MessageInjector"
name="Tick">
+ <property name="to"
value="http://localhost:9900/soap/Tick"/>
+ <property name="soapAction"
value="http://localhost:9900/soap/Tick"/>
+ <property name="message">
+ <tick xmlns="http://mycom.com/ns/tick">
<s>IBM</s>
<p>89.6</p>
</tick>
</property>
- <trigger interval="1"/>
+ <trigger interval="1"/>
</task>
<in>
</in>
- <filter source="get-property('To')"
regex="http://localhost:9.../soap/.*">
- <class
name="org.sciflex.plugins.synapse.esper.mediators.XMLMediator">
- <property name="Configuration">
- <esper-configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://www.espertech.com/schema/esper"
xsi:noNamespaceSchemaLocation="esper-configuration-2-0.xsd">
- <event-type alias="StockQuoteEvent">
- <xml-dom root-element-name="getQuote"
default-namespace="http://services.samples/xsd">
- <namespace-prefix prefix="m0"
namespace="http://services.samples/xsd"/>
- <xpath-property property-name="xsymbol"
xpath="//m0:getQuote/m0:request/m0:symbol" type="string"/>
+ <filter source="get-property('To')"
regex="http://localhost:9.../soap/.*">
+ <class
name="org.sciflex.plugins.synapse.esper.mediators.XMLMediator">
+ <property name="Configuration">
+ <esper-configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns="http://www.espertech.com/schema/esper"
+
xsi:noNamespaceSchemaLocation="esper-configuration-2-0.xsd">
+ <event-type
alias="StockQuoteEvent">
+ <xml-dom
root-element-name="getQuote"
+
default-namespace="http://services.samples/xsd">
+ <namespace-prefix prefix="m0"
namespace="http://services.samples/xsd"/>
+ <xpath-property
property-name="xsymbol"
+
xpath="//m0:getQuote/m0:request/m0:symbol"
type="string"/>
</xml-dom>
</event-type>
- <event-type alias="TickEvent">
- <xml-dom root-element-name="tick"
default-namespace="http://mycom.com/ns/tick">
- <namespace-prefix prefix="t"
namespace="http://mycom.com/ns/tick"/>
- <xpath-property property-name="symbol"
xpath="//t:tick/t:s" type="string"/>
- <xpath-property property-name="price"
xpath="//t:tick/t:p" type="number"/>
+ <event-type alias="TickEvent">
+ <xml-dom root-element-name="tick"
+
default-namespace="http://mycom.com/ns/tick">
+ <namespace-prefix prefix="t"
namespace="http://mycom.com/ns/tick"/>
+ <xpath-property
property-name="symbol" xpath="//t:tick/t:s"
+ type="string"/>
+ <xpath-property
property-name="price" xpath="//t:tick/t:p"
+ type="number"/>
</xml-dom>
</event-type>
</esper-configuration>
</property>
- <property name="Statement" value="select a.price as
price from TickEvent.win:length_batch(10) as a,
StockQuoteEvent.std:lastevent() as b where a.symbol = b.xsymbol"/>
- <property name="EventToAddress"
value="http://localhost:8999/soap/Tick"/>
+ <property name="Statement" value="select
a.price as price from
+ TickEvent.win:length_batch(10) as a,
StockQuoteEvent.std:lastevent() as b
+ where a.symbol = b.xsymbol"/>
+ <property name="EventToAddress"
value="http://localhost:8999/soap/Tick"/>
</class>
</filter>
- <filter source="get-property('To')"
regex="http://localhost:8999/soap/.*">
- <log level="full"/>
+ <filter source="get-property('To')"
regex="http://localhost:8999/soap/.*">
+ <log level="full"/>
</filter>
- <switch source="get-property('To')">
- <case regex="http://localhost:.9../soap/Tick"/>
+ <switch source="get-property('To')">
+ <case regex="http://localhost:.9../soap/Tick"/>
<default>
<send/>
</default>
</switch>
-</definitions></pre>
- <p>
- <strong>Objective: This sample shows how the XML Mediator can be
+</definitions></pre><p><strong>Objective: This sample shows how the
XML Mediator can be
configured to listen to events from two sources, one that generates
events based on the Stock Quote client, and another that generates
events
based on a timer defined in the sample itself. Like sample 0, the
response
- is dropped at the ESB.</strong>
- </p>
- <p>
- <strong>Prerequisites:<br/> </strong>Replace Synapse configuration
with
- "sciflex_sample_4.xml" (save "sciflex_sample_4.xml" as
- "webapp/WEB-INF/classes/conf/synapse.xml").
- <br/> Start the Axis2 server and deploy the SimpleStockQuoteService
if
+ is dropped at the ESB.</strong></p>
+<p><strong>Prerequisites:<br />
+</strong>Replace Synapse configuration with
+ "sciflex_sample_4.xml" (save
"sciflex_sample_4.xml" as
+ "webapp/WEB-INF/classes/conf/synapse.xml").
+ <br />
+ Start the Axis2 server and deploy the SimpleStockQuoteService if
not already deployed.
</p>
- <p>
+<p>
The output generated here is a bit different from the previous
samples.
The logger will keep on logging a particular pattern as seen below
if the
symbol used at the client is IBM, if not nothing is logged.
</p>
-<pre xml:space="preserve">LogMediator To: http://localhost:8999/soap/Tick,
MessageID: urn:uuid:124357E33E9F1C76BD82383704940233-901089966, Direction:
request, Envelope: <?xml version='1.0'
encoding='utf-8'?><soapenv:Envelope
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><ax:map
xmlns:ax="http://ws.apache.org/commons/ns/payload"><ax:entry
name="price"
type="double">89.6</ax:entry></ax:map></soapenv:Body></soapenv:Envelope></pre>
- <p>
+<pre xml:space="preserve">LogMediator To: http://localhost:8999/soap/Tick,
MessageID:
+ urn:uuid:124357E33E9F1C76BD82383704940233-901089966, Direction: request,
Envelope:
+ <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope
+
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><ax:map
+
xmlns:ax="http://ws.apache.org/commons/ns/payload"><ax:entry
name="price" type="double">89.6</ax:entry>
+ </ax:map></soapenv:Body></soapenv:Envelope></pre><p>
Specifying the symbol can be done when executing the client as shown
below.
The symbol specified can be anything. However, to see an output at
the ESB
logger, you must use IBM as the symbol.
</p>
-<pre xml:space="preserve">ant stockquote
-Daddurl=http://localhost:9000/soap/SimpleStockQuoteService
-Dtrpurl=http://localhost:8280/ -Dsymbol=IBM</pre>
- <h1>
- <a name="AxiomMediator" id="AxiomMediator">Axiom Mediator Samples</a>
- </h1>
- <h2>
- <a name="Sample50" id="Sample50">Sample 50: Introduction to Axiom
Mediator</a>
- </h2>
-<pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
- <in>
- <filter source="get-property('To')"
regex="http://localhost:9000/soap/SimpleStockQuoteService">
- <class
name="org.sciflex.plugins.synapse.esper.mediators.AxiomMediator">
- <property name="Configuration">
- <esper-configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://www.espertech.com/schema/esper"
xsi:noNamespaceSchemaLocation="esper-configuration-2-0.xsd">
- <plugin-event-representation
uri="types://xml/apacheaxiom/OMNode"
-
class-name="com.espertech.esperio.representation.axiom.AxiomEventRepresentation"/>
- <plugin-event-type alias="AxiomEvent">
- <resolution-uri
value="types://xml/apacheaxiom/OMNode/AxiomEvent"/>
+<pre xml:space="preserve">ant stockquote
-Daddurl=http://localhost:9000/soap/SimpleStockQuoteService
+ -Dtrpurl=http://localhost:8280/ -Dsymbol=IBM</pre><h1><a
name="AxiomMediator"></a>Axiom Mediator Samples
+ </h1><h2><a name="Sample50"></a>Sample 50: Introduction to Axiom
+ Mediator
+ </h2><pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
+ <in>
+ <filter source="get-property('To')"
regex="http://localhost:9000/soap/SimpleStockQuoteService">
+ <class
name="org.sciflex.plugins.synapse.esper.mediators.AxiomMediator">
+ <property name="Configuration">
+ <esper-configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns="http://www.espertech.com/schema/esper"
+
xsi:noNamespaceSchemaLocation="esper-configuration-2-0.xsd">
+ <plugin-event-representation
uri="types://xml/apacheaxiom/OMNode"
+
class-name="com.espertech.esperio.representation.axiom.AxiomEventRepresentation"/>
+ <plugin-event-type alias="AxiomEvent">
+ <resolution-uri
value="types://xml/apacheaxiom/OMNode/AxiomEvent"/>
<initializer>
- <xml-axiom root-element-name="getQuote"
default-namespace="http://services.samples/xsd">
- <namespace-prefix prefix="m0"
namespace="http://services.samples/xsd"/>
- <xpath-property
property-name="symbol" xpath="//m0:getQuote/m0:request/m0:symbol"
type="string"/>
+ <xml-axiom
root-element-name="getQuote"
+
default-namespace="http://services.samples/xsd">
+ <namespace-prefix
prefix="m0"
+
namespace="http://services.samples/xsd"/>
+ <xpath-property
property-name="symbol"
+
xpath="//m0:getQuote/m0:request/m0:symbol"
type="string"/>
</xml-axiom>
</initializer>
</plugin-event-type>
</esper-configuration>
</property>
- <property name="Statement" value="select symbol from
AxiomEvent"/>
- <property name="EventToAddress"
value="http://localhost:9999/soap/EventListener"/>
+ <property name="Statement" value="select
symbol from AxiomEvent"/>
+ <property name="EventToAddress"
value="http://localhost:9999/soap/EventListener"/>
</class>
</filter>
- <filter source="get-property('To')"
regex="http://localhost:9999/soap/EventListener">
- <log level="full"/>
+ <filter source="get-property('To')"
regex="http://localhost:9999/soap/EventListener">
+ <log level="full"/>
</filter>
</in>
- <switch source="get-property('To')">
- <case regex="http://localhost:9999/soap/EventListener"/>
+ <switch source="get-property('To')">
+ <case
regex="http://localhost:9999/soap/EventListener"/>
<default>
<send/>
</default>
</switch>
-</definitions></pre>
- <p>
- <strong>Objective: This sample serves as an introduction to the Axiom
+</definitions></pre><p><strong>Objective: This sample serves as an
introduction to the Axiom
Mediator, which is used to connect the Esper CEP engine to Apache
Synapse
ESB. This shows how a message that passes through Synapse can be
redirected to the Esper CEP which will identify desired patterns and
report to Synapse. The operation can be observed by monitoring the
response being logged. The response will be dropped at the ESB,
instead of
- being forwarded to further parties.</strong>
- </p>
- <p>
+ being forwarded to further parties.</strong></p>
+<p>
These samples make use of the Stock Quote client that comes with the
WSO2
ESB. Please note that if you are using the Synapse, you will have to
replace the address URL with <strong>
http://localhost:9000/services/SimpleStockQuoteService</strong>. The
Stock
Quote client can operate in the following modes for this example.
</p>
- <ol>
- <li>
+<ol type="1"><li>
Smart Client mode
</li>
- <pre xml:space="preserve">ant stockquote
-Daddurl=http://localhost:9000/soap/SimpleStockQuoteService
-Dtrpurl=http://localhost:8280/</pre>
- <li>
+<pre xml:space="preserve">ant stockquote
-Daddurl=http://localhost:9000/soap/SimpleStockQuoteService
+ -Dtrpurl=http://localhost:8280/</pre><li>
Using Synapse as a HTTP Proxy
</li>
- <pre xml:space="preserve">ant stockquote
-Daddurl=http://localhost:9000/soap/SimpleStockQuoteService
-Dprxurl=http://localhost:8280/</pre>
- </ol>
- <p>
- <strong>Prerequisites:<br/> </strong>Replace Synapse configuration
with
- "sciflex_sample_50.xml" (save "sciflex_sample_50.xml" as
- "webapp/WEB-INF/classes/conf/synapse.xml").
- <br/> Start the Axis2 server and deploy the SimpleStockQuoteService
if
+<pre xml:space="preserve">ant stockquote
-Daddurl=http://localhost:9000/soap/SimpleStockQuoteService
+ -Dprxurl=http://localhost:8280/</pre></ol>
+<p><strong>Prerequisites:<br />
+</strong>Replace Synapse configuration with
+ "sciflex_sample_50.xml" (save
"sciflex_sample_50.xml" as
+ "webapp/WEB-INF/classes/conf/synapse.xml").
+ <br />
+ Start the Axis2 server and deploy the SimpleStockQuoteService if
not already deployed.
</p>
- <p>
- <strong>Executing the Smart Client</strong>
- </p>
- <p>
+<p><strong>Executing the Smart Client</strong></p>
+<p>
When executing the Smart Client, Synapse or the WSO2 ESB will log the
output returned by the Esper CEP (we assume that you have not
changed the
default log output level, which is INFO). If you observe the output
of the
@@ -650,408 +602,418 @@
You will see a message in the Axis2 server console confirming that
the
message got routed to the sample server and the sample service
hosted at
the sample server generating a stock quote for the requested symbol.
The
- Synapse engine logs the message at the "full" log level (i.e. all the
+ Synapse engine logs the message at the "full" log level
(i.e. all the
message headers and the body) and drops the message without
forwarding it.
</p>
-<pre xml:space="preserve">LogMediator To:
http://localhost:9999/soap/EventListener, MessageID:
urn:uuid:A3D5F70CB5E08A2ABE74778911008771-1338866042, Direction: request,
Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><ax:map
xmlns:ax="http://ws.apache.org/commons/ns/payload"><ax:entry
name="symbol"
type="string">IBM</ax:entry></ax:map></soapenv:Body></soapenv:Envelope></pre>
- <p>
+<pre xml:space="preserve">LogMediator To:
http://localhost:9999/soap/EventListener, MessageID:
+ urn:uuid:A3D5F70CB5E08A2ABE74778911008771-1338866042, Direction:
request, Envelope:
+ <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope
+
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><ax:map
+
xmlns:ax="http://ws.apache.org/commons/ns/payload"><ax:entry
name="symbol"
type="string">IBM</ax:entry></pre><p>
The complete mediation process can be observed by instructing the
logger
mechanism to log DEBUG output of the mediator. This can be achieved
by
adding the following line to your log4j configuration (found in
- "webapp/WEB-INF/classes/conf/log4j.properties"). The TRACE mode can
be
+ "webapp/WEB-INF/classes/conf/log4j.properties"). The TRACE
mode can be
used for better observation.
</p>
-<pre
xml:space="preserve">log4j.category.org.sciflex.plugins.synapse.esper=DEBUG</pre>
- <p>
- <strong>Executing the Proxy Client</strong>
- </p>
- <p>
+<pre
xml:space="preserve">log4j.category.org.sciflex.plugins.synapse.esper=DEBUG</pre><p><strong>Executing
the Proxy Client</strong></p>
+<p>
You will see the exact same behavior as per the previous example
when you
run this scenario. However this time the difference is at the
client, as
it sends the message to the WS-Addressing 'To' address
http://localhost:9000/soap/SimpleStockQuoteService, but the transport
specifies Synapse as the HTTP proxy.
</p>
- <h2>
- <a name="Sample51" id="Sample51">Sample 51: Axiom Mediator with ESB
Registry
- Support</a>
- </h2>
-<pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
- <registry provider="org.wso2.esb.registry.ESBRegistry">
- <parameter
name="root">file:repository/conf/sample/resources/</parameter>
- <parameter name="cachableDuration">15000</parameter>
+<h2><a name="Sample51"></a>Sample 51: Axiom Mediator with ESB
+ Registry Support
+ </h2><pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
+ <registry provider="org.wso2.esb.registry.ESBRegistry">
+ <parameter
name="root">file:repository/conf/sample/resources/</parameter>
+ <parameter
name="cachableDuration">15000</parameter>
</registry>
<in>
- <filter source="get-property('To')"
regex="http://localhost:9000/soap/SimpleStockQuoteService">
- <class
name="org.sciflex.plugins.synapse.esper.mediators.AxiomMediator">
- <property name="Configuration">
- <esper-configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://www.espertech.com/schema/esper"
xsi:noNamespaceSchemaLocation="esper-configuration-2-0.xsd">
- <plugin-event-representation
uri="types://xml/apacheaxiom/OMNode"
-
class-name="com.espertech.esperio.representation.axiom.AxiomEventRepresentation"/>
- <plugin-event-type alias="AxiomEvent">
- <resolution-uri
value="types://xml/apacheaxiom/OMNode/AxiomEvent"/>
+ <filter source="get-property('To')"
regex="http://localhost:9000/soap/SimpleStockQuoteService">
+ <class
name="org.sciflex.plugins.synapse.esper.mediators.AxiomMediator">
+ <property name="Configuration">
+ <esper-configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns="http://www.espertech.com/schema/esper"
+
xsi:noNamespaceSchemaLocation="esper-configuration-2-0.xsd">
+ <plugin-event-representation
uri="types://xml/apacheaxiom/OMNode"
+
class-name="com.espertech.esperio.representation.axiom.AxiomEventRepresentation"/>
+ <plugin-event-type alias="AxiomEvent">
+ <resolution-uri
value="types://xml/apacheaxiom/OMNode/AxiomEvent"/>
<initializer>
- <xml-axiom root-element-name="getQuote"
default-namespace="http://services.samples/xsd">
- <namespace-prefix prefix="m0"
namespace="http://services.samples/xsd"/>
- <xpath-property
property-name="symbol" xpath="//m0:getQuote/m0:request/m0:symbol"
type="string"/>
+ <xml-axiom
root-element-name="getQuote"
+
default-namespace="http://services.samples/xsd">
+ <namespace-prefix
prefix="m0"
+
namespace="http://services.samples/xsd"/>
+ <xpath-property
property-name="symbol"
+
xpath="//m0:getQuote/m0:request/m0:symbol"
type="string"/>
</xml-axiom>
</initializer>
</plugin-event-type>
</esper-configuration>
</property>
- <property name="Statement" value="select symbol from
AxiomEvent"/>
- <property name="EventToAddress"
value="http://localhost:9999/soap/EventListener"/>
+ <property name="Statement" value="select
symbol from AxiomEvent"/>
+ <property name="EventToAddress"
value="http://localhost:9999/soap/EventListener"/>
</class>
</filter>
- <filter source="get-property('To')"
regex="http://localhost:9999/soap/EventListener">
- <log level="full"/>
+ <filter source="get-property('To')"
regex="http://localhost:9999/soap/EventListener">
+ <log level="full"/>
</filter>
</in>
- <switch source="get-property('To')">
- <case regex="http://localhost:9999/soap/EventListener">
+ <switch source="get-property('To')">
+ <case
regex="http://localhost:9999/soap/EventListener">
<send>
- <endpoint key="endpoint/endpoint.xml"/>
+ <endpoint key="endpoint/endpoint.xml"/>
</send>
</case>
<default>
<send/>
</default>
</switch>
-</definitions></pre>
- <p>
- <strong>Objective: This sample shows how the Axiom Mediator can be
used in
+</definitions></pre><p><strong>Objective: This sample shows how the
Axiom Mediator can be used in
conjunction with a back-end registry. We have used the ESB Registry
in here
as an example. This sample defers from the previous in the sense that
instead of dropping the sample, the ESB forwards it to the specified
- endpoint.</strong>
- </p>
- <p>
- <strong>Prerequisites:<br/> </strong>Replace Synapse configuration
with
- "sciflex_sample_51.xml" (save "sciflex_sample_51.xml" as
- "webapp/WEB-INF/classes/conf/synapse.xml").
- <br/> Start the Axis2 server and deploy the SimpleStockQuoteService
if
+ endpoint.</strong></p>
+<p><strong>Prerequisites:<br />
+</strong>Replace Synapse configuration with
+ "sciflex_sample_51.xml" (save
"sciflex_sample_51.xml" as
+ "webapp/WEB-INF/classes/conf/synapse.xml").
+ <br />
+ Start the Axis2 server and deploy the SimpleStockQuoteService if
not already deployed.
</p>
- <p>
+<p>
In order to run this sample you will have to deploy the endpoint on
the
- ESB Registry. This can be done by copying the "endpoint" directory
found
- in "resources/registry" to the "registry" directory found inside the
ESB
+ ESB Registry. This can be done by copying the "endpoint"
directory found
+ in "resources/registry" to the "registry"
directory found inside the ESB
installation (you should see directories such as, Policy, Schema,
Scripts
in this directory).
</p>
- <p>
+<p>
The structure of the endpoint used here is the same as the ones used
in
Synapse. More information is found
- <a
href="http://synapse.apache.org/Synapse_Configuration_Language.html#endpoint">
+ <a
href="http://synapse.apache.org/Synapse_Configuration_Language.html#endpoint"
class="externalLink">
here</a>.
</p>
- <h2>
- <a name="Sample52" id="Sample52">Sample 52: Axiom Mediator using EPL
Statement
- stored as XML on Registry</a>
- </h2>
-<pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
- <registry provider="org.wso2.esb.registry.ESBRegistry">
- <parameter
name="root">file:repository/conf/sample/resources/</parameter>
- <parameter name="cachableDuration">15000</parameter>
+<h2><a name="Sample52"></a>Sample 52: Axiom Mediator using EPL
+ Statement stored as XML on Registry
+ </h2><pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
+ <registry provider="org.wso2.esb.registry.ESBRegistry">
+ <parameter
name="root">file:repository/conf/sample/resources/</parameter>
+ <parameter
name="cachableDuration">15000</parameter>
</registry>
<in>
- <filter source="get-property('To')"
regex="http://localhost:9000/soap/SimpleStockQuoteService">
- <class
name="org.sciflex.plugins.synapse.esper.mediators.AxiomMediator">
- <property name="Configuration">
- <esper-configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://www.espertech.com/schema/esper"
xsi:noNamespaceSchemaLocation="esper-configuration-2-0.xsd">
- <plugin-event-representation
uri="types://xml/apacheaxiom/OMNode"
-
class-name="com.espertech.esperio.representation.axiom.AxiomEventRepresentation"/>
- <plugin-event-type alias="AxiomEvent">
- <resolution-uri
value="types://xml/apacheaxiom/OMNode/AxiomEvent"/>
+ <filter source="get-property('To')"
regex="http://localhost:9000/soap/SimpleStockQuoteService">
+ <class
name="org.sciflex.plugins.synapse.esper.mediators.AxiomMediator">
+ <property name="Configuration">
+ <esper-configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns="http://www.espertech.com/schema/esper"
+
xsi:noNamespaceSchemaLocation="esper-configuration-2-0.xsd">
+ <plugin-event-representation
uri="types://xml/apacheaxiom/OMNode"
+
class-name="com.espertech.esperio.representation.axiom.AxiomEventRepresentation"/>
+ <plugin-event-type alias="AxiomEvent">
+ <resolution-uri
value="types://xml/apacheaxiom/OMNode/AxiomEvent"/>
<initializer>
- <xml-axiom root-element-name="getQuote"
default-namespace="http://services.samples/xsd">
- <namespace-prefix prefix="m0"
namespace="http://services.samples/xsd"/>
- <xpath-property
property-name="symbol" xpath="//m0:getQuote/m0:request/m0:symbol"
type="string"/>
+ <xml-axiom
root-element-name="getQuote"
+
default-namespace="http://services.samples/xsd">
+ <namespace-prefix
prefix="m0"
+
namespace="http://services.samples/xsd"/>
+ <xpath-property
property-name="symbol"
+
xpath="//m0:getQuote/m0:request/m0:symbol"
type="string"/>
</xml-axiom>
</initializer>
</plugin-event-type>
</esper-configuration>
</property>
- <property name="Statement">
- <epl-statement
key="statement/statement_axiom.xml"/>
+ <property name="Statement">
+ <epl-statement
key="statement/statement_axiom.xml"/>
</property>
- <property name="EventToAddress"
value="http://localhost:9999/soap/EventListener"/>
+ <property name="EventToAddress"
value="http://localhost:9999/soap/EventListener"/>
</class>
</filter>
- <filter source="get-property('To')"
regex="http://localhost:9999/soap/EventListener">
- <log level="full"/>
+ <filter source="get-property('To')"
regex="http://localhost:9999/soap/EventListener">
+ <log level="full"/>
</filter>
</in>
- <switch source="get-property('To')">
- <case regex="http://localhost:9999/soap/EventListener"/>
+ <switch source="get-property('To')">
+ <case
regex="http://localhost:9999/soap/EventListener"/>
<default>
<send/>
</default>
</switch>
-</definitions></pre>
- <p>
- <strong>Objective: This sample shows how the Axiom Mediator can be
used in
+</definitions></pre><p><strong>Objective: This sample shows how the
Axiom Mediator can be used in
conjunction with a EPL statement stored in a back-end registry. We
have
used the ESB Registry in here as an example. This sample defers from
the
sample 50, in the sense that the EPL statement is dynamically loaded
from
- the back-end registry.</strong>
- </p>
- <p>
- <strong>Prerequisites:<br/> </strong>Replace Synapse configuration
with
- "sciflex_sample_52.xml" (save "sciflex_sample_52.xml" as
- "webapp/WEB-INF/classes/conf/synapse.xml").
- <br/> Start the Axis2 server and deploy the SimpleStockQuoteService
if
+ the back-end registry.</strong></p>
+<p><strong>Prerequisites:<br />
+</strong>Replace Synapse configuration with
+ "sciflex_sample_52.xml" (save
"sciflex_sample_52.xml" as
+ "webapp/WEB-INF/classes/conf/synapse.xml").
+ <br />
+ Start the Axis2 server and deploy the SimpleStockQuoteService if
not already deployed.
</p>
- <p>
+<p>
In order to run this sample you will have to deploy the statements
on the
- ESB Registry. This can be done by copying the "statement" directory
found
- in "resources/registry" to the "registry" directory found inside the
ESB
+ ESB Registry. This can be done by copying the "statement"
directory found
+ in "resources/registry" to the "registry"
directory found inside the ESB
installation (you should see directories such as, Policy, Schema,
Scripts
in this directory).
</p>
- <p>
+<p>
The expected format of the statement in XML is as shown below. The
content
in the value attribute denotes the EPL query used.
</p>
-<pre xml:space="preserve"><epl value="select symbol from
AxiomEvent"/></pre>
- <h2>
- <a name="Sample53" id="Sample53">Sample 53: Axiom Mediator using EPL
Statement
- and Endpoint stored on Registry</a>
- </h2>
-<pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
- <registry provider="org.wso2.esb.registry.ESBRegistry">
- <parameter
name="root">file:repository/conf/sample/resources/</parameter>
- <parameter name="cachableDuration">15000</parameter>
+<pre xml:space="preserve"><epl value="select symbol from
AxiomEvent"/></pre><h2><a name="Sample53"></a>Sample 53: Axiom
Mediator using EPL
+ Statement and Endpoint stored on Registry
+ </h2><pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
+ <registry provider="org.wso2.esb.registry.ESBRegistry">
+ <parameter
name="root">file:repository/conf/sample/resources/</parameter>
+ <parameter
name="cachableDuration">15000</parameter>
</registry>
<in>
- <filter source="get-property('To')"
regex="http://localhost:9000/soap/SimpleStockQuoteService">
- <class
name="org.sciflex.plugins.synapse.esper.mediators.AxiomMediator">
- <property name="Configuration">
- <esper-configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://www.espertech.com/schema/esper"
xsi:noNamespaceSchemaLocation="esper-configuration-2-0.xsd">
- <plugin-event-representation
uri="types://xml/apacheaxiom/OMNode"
-
class-name="com.espertech.esperio.representation.axiom.AxiomEventRepresentation"/>
- <plugin-event-type alias="AxiomEvent">
- <resolution-uri
value="types://xml/apacheaxiom/OMNode/AxiomEvent"/>
+ <filter source="get-property('To')"
regex="http://localhost:9000/soap/SimpleStockQuoteService">
+ <class
name="org.sciflex.plugins.synapse.esper.mediators.AxiomMediator">
+ <property name="Configuration">
+ <esper-configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns="http://www.espertech.com/schema/esper"
+
xsi:noNamespaceSchemaLocation="esper-configuration-2-0.xsd">
+ <plugin-event-representation
uri="types://xml/apacheaxiom/OMNode"
+
class-name="com.espertech.esperio.representation.axiom.AxiomEventRepresentation"/>
+ <plugin-event-type alias="AxiomEvent">
+ <resolution-uri
value="types://xml/apacheaxiom/OMNode/AxiomEvent"/>
<initializer>
- <xml-axiom root-element-name="getQuote"
default-namespace="http://services.samples/xsd">
- <namespace-prefix prefix="m0"
namespace="http://services.samples/xsd"/>
- <xpath-property
property-name="symbol" xpath="//m0:getQuote/m0:request/m0:symbol"
type="string"/>
+ <xml-axiom
root-element-name="getQuote"
+
default-namespace="http://services.samples/xsd">
+ <namespace-prefix
prefix="m0"
+
namespace="http://services.samples/xsd"/>
+ <xpath-property
property-name="symbol"
+
xpath="//m0:getQuote/m0:request/m0:symbol"
type="string"/>
</xml-axiom>
</initializer>
</plugin-event-type>
</esper-configuration>
</property>
- <property name="Statement">
- <epl-statement
key="statement/statement_axiom.epl"/>
+ <property name="Statement">
+ <epl-statement
key="statement/statement_axiom.epl"/>
</property>
- <property name="EventToAddress"
value="http://localhost:9999/soap/EventListener"/>
+ <property name="EventToAddress"
value="http://localhost:9999/soap/EventListener"/>
</class>
</filter>
- <filter source="get-property('To')"
regex="http://localhost:9999/soap/EventListener">
- <log level="full"/>
+ <filter source="get-property('To')"
regex="http://localhost:9999/soap/EventListener">
+ <log level="full"/>
</filter>
</in>
- <switch source="get-property('To')">
- <case regex="http://localhost:9999/soap/EventListener">
+ <switch source="get-property('To')">
+ <case
regex="http://localhost:9999/soap/EventListener">
<send>
- <endpoint key="endpoint/endpoint.xml"/>
+ <endpoint key="endpoint/endpoint.xml"/>
</send>
</case>
<default>
<send/>
</default>
</switch>
-</definitions></pre>
- <p>
- <strong>Objective: This sample shows how the Axiom Mediator can be
used in
+</definitions></pre><p><strong>Objective: This sample shows how the
Axiom Mediator can be used in
conjunction with a EPL statement and an endpoint stored in a back-end
registry. This sample combines the samples 51, and 52 above except
for the
fact that the query is stored as a text file instead of an XML file.
- </strong>
- </p>
- <p>
- <strong>Prerequisites:<br/> </strong>Replace Synapse configuration
with
- "sciflex_sample_53.xml" (save "sciflex_sample_53.xml" as
- "webapp/WEB-INF/classes/conf/synapse.xml").
- <br/> Start the Axis2 server and deploy the SimpleStockQuoteService
if
+ </strong></p>
+<p><strong>Prerequisites:<br />
+</strong>Replace Synapse configuration with
+ "sciflex_sample_53.xml" (save
"sciflex_sample_53.xml" as
+ "webapp/WEB-INF/classes/conf/synapse.xml").
+ <br />
+ Start the Axis2 server and deploy the SimpleStockQuoteService if
not already deployed.
</p>
- <p>
+<p>
You need to deploy the statements as well as the endpoint on the
registry
to run this sample. Refer samples 51, and 52 above for more
information.
</p>
- <p>
+<p>
The format of the query stored on the registry is as shown below. We
have
used the desired *.epl extension to denote these files.
</p>
-<pre xml:space="preserve">select symbol from AxiomEvent</pre>
- <h2>
- <a name="Sample54" id="Sample54">Sample 54: Axiom Mediator with WSO2
Registry
- Support</a>
- </h2>
-<pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
- <registry provider="org.wso2.esb.registry.WSO2Registry">
- <parameter name="root">/</parameter>
- <parameter name="cachableDuration">15000</parameter>
+<pre xml:space="preserve">select symbol from AxiomEvent</pre><h2><a
name="Sample54"></a>Sample 54: Axiom Mediator with WSO2
+ Registry Support
+ </h2><pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
+ <registry
provider="org.wso2.esb.registry.WSO2Registry">
+ <parameter name="root">/</parameter>
+ <parameter
name="cachableDuration">15000</parameter>
</registry>
<in>
- <filter source="get-property('To')"
regex="http://localhost:9000/soap/SimpleStockQuoteService">
- <class
name="org.sciflex.plugins.synapse.esper.mediators.AxiomMediator">
- <property name="Configuration">
- <esper-configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://www.espertech.com/schema/esper"
xsi:noNamespaceSchemaLocation="esper-configuration-2-0.xsd">
- <plugin-event-representation
uri="types://xml/apacheaxiom/OMNode"
-
class-name="com.espertech.esperio.representation.axiom.AxiomEventRepresentation"/>
- <plugin-event-type alias="AxiomEvent">
- <resolution-uri
value="types://xml/apacheaxiom/OMNode/AxiomEvent"/>
+ <filter source="get-property('To')"
regex="http://localhost:9000/soap/SimpleStockQuoteService">
+ <class
name="org.sciflex.plugins.synapse.esper.mediators.AxiomMediator">
+ <property name="Configuration">
+ <esper-configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns="http://www.espertech.com/schema/esper"
+
xsi:noNamespaceSchemaLocation="esper-configuration-2-0.xsd">
+ <plugin-event-representation
uri="types://xml/apacheaxiom/OMNode"
+
class-name="com.espertech.esperio.representation.axiom.AxiomEventRepresentation"/>
+ <plugin-event-type alias="AxiomEvent">
+ <resolution-uri
value="types://xml/apacheaxiom/OMNode/AxiomEvent"/>
<initializer>
- <xml-axiom root-element-name="getQuote"
default-namespace="http://services.samples/xsd">
- <namespace-prefix prefix="m0"
namespace="http://services.samples/xsd"/>
- <xpath-property
property-name="symbol" xpath="//m0:getQuote/m0:request/m0:symbol"
type="string"/>
+ <xml-axiom
root-element-name="getQuote"
+
default-namespace="http://services.samples/xsd">
+ <namespace-prefix
prefix="m0"
+
namespace="http://services.samples/xsd"/>
+ <xpath-property
property-name="symbol"
+
xpath="//m0:getQuote/m0:request/m0:symbol"
type="string"/>
</xml-axiom>
</initializer>
</plugin-event-type>
</esper-configuration>
</property>
- <property name="Statement">
- <epl-statement
key="statement/statement_axiom.epl"/>
+ <property name="Statement">
+ <epl-statement
key="statement/statement_axiom.epl"/>
</property>
- <property name="EventToAddress"
value="http://localhost:9999/soap/EventListener"/>
+ <property name="EventToAddress"
value="http://localhost:9999/soap/EventListener"/>
</class>
</filter>
- <filter source="get-property('To')"
regex="http://localhost:9999/soap/EventListener">
- <log level="full"/>
+ <filter source="get-property('To')"
regex="http://localhost:9999/soap/EventListener">
+ <log level="full"/>
</filter>
</in>
- <switch source="get-property('To')">
- <case regex="http://localhost:9999/soap/EventListener">
+ <switch source="get-property('To')">
+ <case
regex="http://localhost:9999/soap/EventListener">
<send>
- <endpoint key="endpoint/endpoint.xml"/>
+ <endpoint key="endpoint/endpoint.xml"/>
</send>
</case>
<default>
<send/>
</default>
</switch>
-</definitions></pre>
- <p>
- <strong>Objective: This sample shows how the Axiom Mediator can be
used in
+</definitions></pre><p><strong>Objective: This sample shows how the
Axiom Mediator can be used in
conjunction with a EPL statement and an endpoint stored in a back-end
registry. This sample is quite similar to the sample above except it
uses
the WSO2 Registry as a back-end registry instead of the ESB Registry.
- </strong>
- </p>
- <p>
- <strong>Prerequisites:<br/> </strong>Replace Synapse configuration
with
- "sciflex_sample_54.xml" (save "sciflex_sample_54.xml" as
- "webapp/WEB-INF/classes/conf/synapse.xml").
- <br/> Start the Axis2 server and deploy the SimpleStockQuoteService
if
+ </strong></p>
+<p><strong>Prerequisites:<br />
+</strong>Replace Synapse configuration with
+ "sciflex_sample_54.xml" (save
"sciflex_sample_54.xml" as
+ "webapp/WEB-INF/classes/conf/synapse.xml").
+ <br />
+ Start the Axis2 server and deploy the SimpleStockQuoteService if
not already deployed.
</p>
- <p>
+<p>
You need to deploy the statements as well as the endpoint on the
registry
to run this sample. More information on how to deploy resources on
the
WSO2 Registry can be found
- <a
href="http://wso2.org/project/registry/1.1/docs/userguide.html">here
+ <a href="http://wso2.org/project/registry/1.1/docs/userguide.html"
class="externalLink">here
</a>. The resources should now be accessible via registry keys
- "endpoint/endpoint.xml", and "statement/statement_axiom.epl".
+ "endpoint/endpoint.xml", and
"statement/statement_axiom.epl".
</p>
- <h2>
- <a name="Sample55" id="Sample55">Sample 55: Multiple Mediator
Sample, using XML
- Mediator and Axiom Mediator</a>
- </h2>
-<pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
- <task class="org.apache.synapse.startup.tasks.MessageInjector"
name="Tick">
- <property name="to" value="http://localhost:9900/soap/Tick"/>
- <property name="soapAction"
value="http://localhost:9900/soap/Tick"/>
- <property name="message">
- <tick xmlns="http://mycom.com/ns/tick">
+<h2><a name="Sample55"></a>Sample 55: Multiple Mediator Sample,
+ using XML Mediator and Axiom Mediator
+ </h2><pre xml:space="preserve"><definitions
xmlns="http://ws.apache.org/ns/synapse">
+ <task
class="org.apache.synapse.startup.tasks.MessageInjector"
name="Tick">
+ <property name="to"
value="http://localhost:9900/soap/Tick"/>
+ <property name="soapAction"
value="http://localhost:9900/soap/Tick"/>
+ <property name="message">
+ <tick xmlns="http://mycom.com/ns/tick">
<s>IBM</s>
<p>89.6</p>
</tick>
</property>
- <trigger interval="1"/>
+ <trigger interval="1"/>
</task>
<in>
- <filter source="get-property('To')"
regex="http://localhost:9000/soap/SimpleStockQuoteService">
- <class
name="org.sciflex.plugins.synapse.esper.mediators.XMLMediator">
- <property name="Configuration">
- <esper-configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://www.espertech.com/schema/esper"
xsi:noNamespaceSchemaLocation="esper-configuration-2-0.xsd">
- <event-type alias="StockQuoteEvent">
- <xml-dom root-element-name="getQuote"
default-namespace="http://services.samples/xsd">
- <namespace-prefix prefix="m0"
namespace="http://services.samples/xsd"/>
- <xpath-property property-name="xsymbol"
xpath="//m0:getQuote/m0:request/m0:symbol" type="string"/>
+ <filter source="get-property('To')"
regex="http://localhost:9000/soap/SimpleStockQuoteService">
+ <class
name="org.sciflex.plugins.synapse.esper.mediators.XMLMediator">
+ <property name="Configuration">
+ <esper-configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns="http://www.espertech.com/schema/esper"
+
xsi:noNamespaceSchemaLocation="esper-configuration-2-0.xsd">
+ <event-type
alias="StockQuoteEvent">
+ <xml-dom
root-element-name="getQuote"
+
default-namespace="http://services.samples/xsd">
+ <namespace-prefix prefix="m0"
+
namespace="http://services.samples/xsd"/>
+ <xpath-property
property-name="xsymbol"
+
xpath="//m0:getQuote/m0:request/m0:symbol"
type="string"/>
</xml-dom>
</event-type>
- <plugin-event-representation
uri="type://xml/apacheaxiom/OMNode"
-
class-name="com.espertech.esperio.representation.axiom.AxiomEventRepresentation"/>
- <plugin-event-type alias="AxiomEvent">
- <resolution-uri
value="type://xml/apacheaxiom/OMNode"/>
+ <plugin-event-representation
uri="type://xml/apacheaxiom/OMNode"
+
class-name="com.espertech.esperio.representation.axiom.AxiomEventRepresentation"/>
+ <plugin-event-type
alias="AxiomEvent">
+ <resolution-uri
value="type://xml/apacheaxiom/OMNode"/>
<initializer>
- <xml-axiom root-element-name="tick"
default-namespace="http://mycom.com/ns/tick">
- <namespace-prefix prefix="t"
namespace="http://mycom.com/ns/tick"/>
- <xpath-property
property-name="symbol" xpath="//t:tick/t:s" type="string"/>
- <xpath-property
property-name="price" xpath="//t:tick/t:p" type="number"/>
+ <xml-axiom
root-element-name="tick"
+
default-namespace="http://mycom.com/ns/tick">
+ <namespace-prefix
prefix="t" namespace="http://mycom.com/ns/tick"/>
+ <xpath-property
property-name="symbol" xpath="//t:tick/t:s"
+ type="string"/>
+ <xpath-property
property-name="price" xpath="//t:tick/t:p"
+ type="number"/>
</xml-axiom>
</initializer>
</plugin-event-type>
</esper-configuration>
</property>
- <property name="InstanceURI"
value="urn:CEPInstance"/>
- <property name="Statement" value="select xsymbol from
StockQuoteEvent"/>
- <property name="EventToAddress"
value="http://localhost:8999/soap/EventListener"/>
+ <property name="InstanceURI"
value="urn:CEPInstance"/>
+ <property name="Statement" value="select
xsymbol from StockQuoteEvent"/>
+ <property name="EventToAddress"
value="http://localhost:8999/soap/EventListener"/>
</class>
</filter>
</in>
- <filter source="get-property('To')"
regex="http://localhost:9900/soap/Tick">
- <class
name="org.sciflex.plugins.synapse.esper.mediators.AxiomMediator">
- <property name="InstanceURI" value="urn:CEPInstance"/>
- <property name="Statement" value="select a.price as price
from AxiomEvent.win:length_batch(10) as a, StockQuoteEvent.std:lastevent()
as b where a.symbol = b.xsymbol"/>
- <property name="EventToAddress"
value="http://localhost:8999/soap/Tick"/>
+ <filter source="get-property('To')"
regex="http://localhost:9900/soap/Tick">
+ <class
name="org.sciflex.plugins.synapse.esper.mediators.AxiomMediator">
+ <property name="InstanceURI"
value="urn:CEPInstance"/>
+ <property name="Statement" value="select
a.price as price from
+ AxiomEvent.win:length_batch(10) as a,
StockQuoteEvent.std:lastevent() as b
+ where a.symbol = b.xsymbol"/>
+ <property name="EventToAddress"
value="http://localhost:8999/soap/Tick"/>
</class>
</filter>
- <filter source="get-property('To')"
regex="http://localhost:8999/soap/.*">
- <log level="full"/>
+ <filter source="get-property('To')"
regex="http://localhost:8999/soap/.*">
+ <log level="full"/>
</filter>
- <switch source="get-property('To')">
- <case regex="http://localhost:.9../soap/.*"/>
+ <switch source="get-property('To')">
+ <case regex="http://localhost:.9../soap/.*"/>
<default>
<send/>
</default>
</switch>
-</definitions></pre>
- <p>
- <strong>Objective: This sample shows how the XML Mediator and the
Axiom
+</definitions></pre><p><strong>Objective: This sample shows how the
XML Mediator and the Axiom
Mediator can be configured in conjunction to listen to events from
two
sources, one that generates events based on the Stock Quote client,
and
another that generates events based on a timer defined in the sample
- itself. Like sample 50, the response is dropped at the ESB.</strong>
- </p>
- <p>
+ itself. Like sample 50, the response is dropped at the
ESB.</strong></p>
+<p>
The output generated here is a bit different from the previous
samples.
The logger will keep on logging a particular pattern as seen below
if the
symbol used at the client is IBM.
</p>
-<pre xml:space="preserve">LogMediator To: http://localhost:8999/soap/Tick,
MessageID: urn:uuid:124357E33E9F1C76BD82383704940233-901089966, Direction:
request, Envelope: <?xml version='1.0'
encoding='utf-8'?><soapenv:Envelope
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><ax:map
xmlns:ax="http://ws.apache.org/commons/ns/payload"><ax:entry
name="price"
type="double">89.6</ax:entry></ax:map></soapenv:Body></soapenv:Envelope></pre>
- <p>
+<pre xml:space="preserve">LogMediator To: http://localhost:8999/soap/Tick,
MessageID:
+ urn:uuid:124357E33E9F1C76BD82383704940233-901089966, Direction: request,
Envelope:
+ <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope
+
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body>
+ <ax:map
xmlns:ax="http://ws.apache.org/commons/ns/payload">
+ <ax:entry name="price"
type="double">89.6</ax:entry></ax:map></soapenv:Body></soapenv:Envelope></pre><p>
Specifying the symbol can be done when executing the client as shown
below.
The symbol specified can be anything. However, to see the above
output at
the ESB logger, you must use IBM as the symbol.
</p>
-<pre xml:space="preserve">ant stockquote
-Daddurl=http://localhost:9000/soap/SimpleStockQuoteService
-Dtrpurl=http://localhost:8280/ -Dsymbol=IBM</pre>
- <p>
+<pre xml:space="preserve">ant stockquote
-Daddurl=http://localhost:9000/soap/SimpleStockQuoteService
+ -Dtrpurl=http://localhost:8280/ -Dsymbol=IBM</pre><p>
Another output is seen at the ESB irrespective of the symbol used.
For
example if you use MSFT as the symbol, you should get something as
seen
below. This sample is similar to sample 4, except that it has this
additional behavior. This is due to the use of an additional query
at the
second mediator.
</p>
-<pre xml:space="preserve">LogMediator To:
http://localhost:8999/soap/EventListener, MessageID:
urn:uuid:879D0AE84B6D830F1A858063203638432063059771, Direction: request,
Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><ax:map
xmlns:ax="http://ws.apache.org/commons/ns/payload"><ax:entry
name="xsymbol"
type="string">MSFT</ax:entry></ax:map></soapenv:Body></soapenv:Envelope></pre>
- </div>
- </body>
+<pre xml:space="preserve">LogMediator To:
http://localhost:8999/soap/EventListener, MessageID:
+ urn:uuid:879D0AE84B6D830F1A858063203638432063059771, Direction: request,
Envelope:
+ <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope
+
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body>
+ <ax:map
xmlns:ax="http://ws.apache.org/commons/ns/payload">
+ <ax:entry name="xsymbol"
type="string">MSFT</ax:entry></ax:map></soapenv:Body></soapenv:Envelope></pre></div>
+ </body>
</document>