|
Key
This line was removed.
This word was removed. This word was added.
This line was added.
|
Changes (21)
View Page Historyh2. Overall solution
We want to call the operation "AddIntegers" on a service "MathOperations", using a buffer. This operation buffer to process all operations in one time. MathOperations needs two integer parameters, <integer1> and <integer2>, and returns their sum.
We will send messages to an EIP pattern "Aggregator". It will bufferize all messages, until he gets a trigger message. Then it sends the whole buffer, aggregated in one single message, to the next service, EIP Splitter. It will split back the aggregated message into several messages, and send them to the next step, "AddIntegers" operation, to process all messages.
Message process :
* Send several messages to an EIP pattern "Aggregator", which bufferize the messages
* Send a trigger message to *EipAggregator*
* *EipAggregator* sends an aggregated message to the next step, *EipSPlitter* in our case.
* *EipSplitter* splits the aggregated message into the multiple messages.
* *EipSPlitter* sends the multiple messages to the operation *AddIntegers*, in operation *MathOperations*
* *MathOperations.AddIntegers* processes the messages and sends a response
* Send a trigger message to *EipAggregator*
* *EipAggregator* sends an aggregated message to the next step, *EipSPlitter* in our case.
* *EipSplitter* splits the aggregated message into the multiple messages.
* *EipSPlitter* sends the multiple messages to the operation *AddIntegers*, in operation *MathOperations*
* *MathOperations.AddIntegers* processes the messages and sends a response
h2. Petals Settings and Messages Flows
*This usecase was tested with:*
# Petals ESB 3.1, Petals-SE-EIP 2.4.3, Petals-SE-JSR181 1.1.3, Petals-SE-RMI-1.1.1, Petals webconsole 2.0.3. Configurations were generated using Petals Studio 1.1.0
* Petals ESB 3.1, Petals-SE-EIP 2.4.3, Petals-SE-Jsr-181 1.1.3, Petals-SE-RMI-1.1.1, Petals webconsole 2.0.3. Configurations were generated using Petals Studio 1.1.0
h1. Configuring the sample JSR181 Service Unit
{code:language=java|title=MyMathOperations.java}package test.ebmwebsourcing.com;
//import javax.jws.Oneway;
{code:language=xml|title=MyMathOperations_schema1.xsd|collapse=true|theme=Default}<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema version="1.0" targetNamespace="http://com.ebmwebsourcing.test" xmlns:tns="http://com.ebmwebsourcing.test" xmlns:xs="http://www.w3.org/2001/XMLSchema">
</xs:schema>{code}
{code:language=xml|title=MyMathOperations.wsdl|collapse=true|theme=Default}<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
{code:lang=xml|title=jbi.xml|collapse}<?xml version="1.0" encoding="UTF-8"?>
<!-- JBI descriptor for the Petals component petals-se-jsr181 -->
<jbi:jbi version="1.0"
xmlns:jbi="http://java.sun.com/xml/ns/jbi"
xmlns:jsr181="http://petals.ow2.org/components/jsr181/version-1"
xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<jbi:services binding-component="false">
<jbi:provides
interface-name="generatedNs:MyMathOperations"
service-name="generatedNs:MyMathOperations"
endpoint-name="MyMathOperationsPort"
xmlns:generatedNs="http://com.ebmwebsourcing.test">
<!-- CDK elements -->
<petalsCDK:wsdl>MyMathOperations.wsdl</petalsCDK:wsdl>
<!-- Component specific elements -->
<jsr181:class>test.ebmwebsourcing.com.MyMathOperations</jsr181:class>
</jbi:provides>
</jbi:services>
</jbi:jbi>{code}
{code:lang=xml|title=MyMathOperations.wsdl}<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- JBI descriptor for the Petals component petals-se-jsr181 -->
<jbi:jbi version="1.0"
xmlns:jbi="http://java.sun.com/xml/ns/jbi"
xmlns:jsr181="http://petals.ow2.org/components/jsr181/version-1"
xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<jbi:services binding-component="false">
<jbi:provides
interface-name="generatedNs:MyMathOperations"
service-name="generatedNs:MyMathOperations"
endpoint-name="MyMathOperationsPort"
xmlns:generatedNs="http://com.ebmwebsourcing.test">
<!-- CDK elements -->
<petalsCDK:wsdl>MyMathOperations.wsdl</petalsCDK:wsdl>
<!-- Component specific elements -->
<jsr181:class>test.ebmwebsourcing.com.MyMathOperations</jsr181:class>
</jbi:provides>
</jbi:services>
</jbi:jbi>{code}
{code:lang=xml|title=MyMathOperations.wsdl}<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.6 in JDK 6. -->
<definitions targetNamespace="http://com.ebmwebsourcing.test" name="MyMathOperations" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://com.ebmwebsourcing.test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<definitions targetNamespace="http://com.ebmwebsourcing.test" name="MyMathOperations" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://com.ebmwebsourcing.test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
</definitions>{code}
{code:language=xml|title=jbi.xml|collapse=true|theme=Default}<?xml version="1.0" encoding="UTF-8"?>
<!-- JBI descriptor for the Petals component petals-se-jsr181 -->
<jbi:jbi version="1.0"
xmlns:jbi="http://java.sun.com/xml/ns/jbi"
xmlns:jsr181="http://petals.ow2.org/components/jsr181/version-1"
xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<jbi:services binding-component="false">
<jbi:provides
interface-name="generatedNs:MyMathOperations"
service-name="generatedNs:MyMathOperations"
endpoint-name="MyMathOperationsPort"
xmlns:generatedNs="http://com.ebmwebsourcing.test">
<!-- CDK elements -->
<petalsCDK:wsdl>MyMathOperations.wsdl</petalsCDK:wsdl>
<!-- Component specific elements -->
<jsr181:class>test.ebmwebsourcing.com.MyMathOperations</jsr181:class>
</jbi:provides>
</jbi:services>
</jbi:jbi>{code}
<!-- JBI descriptor for the Petals component petals-se-jsr181 -->
<jbi:jbi version="1.0"
xmlns:jbi="http://java.sun.com/xml/ns/jbi"
xmlns:jsr181="http://petals.ow2.org/components/jsr181/version-1"
xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<jbi:services binding-component="false">
<jbi:provides
interface-name="generatedNs:MyMathOperations"
service-name="generatedNs:MyMathOperations"
endpoint-name="MyMathOperationsPort"
xmlns:generatedNs="http://com.ebmwebsourcing.test">
<!-- CDK elements -->
<petalsCDK:wsdl>MyMathOperations.wsdl</petalsCDK:wsdl>
<!-- Component specific elements -->
<jsr181:class>test.ebmwebsourcing.com.MyMathOperations</jsr181:class>
</jbi:provides>
</jbi:services>
</jbi:jbi>{code}
The method will be packaged in su-jsr181-MathOperations-provide
h2. SE-EIP Aggregator
{code:language=xml|title=jbi.xml}<?xml version="1.0" encoding="UTF-8"?>
<jbi:jbi version="1.0"
xmlns:eip="http://petals.ow2.org/components/eip/version-2"
xmlns:eip="http://petals.ow2.org/components/eip/version-2"
h2. SE-EIP Splitter
{code:language=xml|title=jbi.xml}<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<jbi:jbi version="1.0"
<jbi:jbi version="1.0"
{code:language=xml|title=jbi.xml|collapse=true|theme=Default}
<?xml version="1.0" encoding="UTF-8"?>
<jbi:jbi version="1.0" xmlns="http://java.sun.com/xml/ns/jbi"
<jbi:jbi version="1.0" xmlns="http://java.sun.com/xml/ns/jbi"
Then we can send test messages from the webconsole. For example, we will send three messages, with InOut MEP (message exchange pattern), and then send the trigger message.
{code:language=xml|title=Message 1|theme=Default}
<AddIntegers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<integer1>1</integer1>
<integer1>1</integer1>
When everything is fine, you get this response, just saying the message was buffered :
{code:language=xml|title=Response message|theme=Default}
<result xmlns="http://petals.ow2.org/petals-se-eip/aggregator">Aggregator: the content is buffered by the pattern</result>
{code}
We can continue to bufferize messages...
{code}
We can continue to bufferize messages...
{code:language=xml|title=Message 2|theme=Default}
<AddIntegers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<integer1>3</integer1>
<integer1>3</integer1>
{code}
{code:language=xml|title=Message 3|theme=Default}
<AddIntegers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<integer1>5</integer1>
<integer1>5</integer1>
Let us send the trigger message :
{code:language=xml|title=Message 4 - Trigger|theme=Default}
<AddIntegers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<equals/>
<equals/>
Now all messages are processed by MathOperations :
{code:language=xml|title=Response message|theme=Default}
<result xmlns="http://petals.ow2.org/petals-se-eip/splitter">
<dlwmin:AddIntegersResponse xmlns:dlwmin="http://com.ebmwebsourcing.test" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<dlwmin:AddIntegersResponse xmlns:dlwmin="http://com.ebmwebsourcing.test" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">