Petals Getting started - day 5 - EIP Orchestration

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (36)

View Page History


< eip:aggregator-correlation > boolean(/*\[local-name()="AddIntegers"\]) </ eip:aggregator-correlation >
{code:lang=xml}<eip:aggregator-correlation>boolean(/*[local-name()="AddIntegers"])</eip:aggregator-correlation>{code}
Messages which satisfy "aggregator-correlation" will be aggregated. <=> Elements inside <AddIntegers> will be aggregated.


< eip:test > boolean(/*\[local-name()="AddIntegers"\]/*\[local-name()="equals"\]) </ eip:test >
{code:lang=xml}<eip:test>boolean(/*[local-name()="AddIntegers"]/*[local-name()="equals"])</eip:test>{code}
Messages which satisfy "test" act as the, to send the aggregated buffer. <=> If <AddIntegers> contains <equals> element, aggregated message is sent to the next service and buffer cleared.

*EIP Splitter*

< eip:test > //*\[local-name()="AddIntegers"\] </ eip:test >
{code:lang=xml}<eip:test>//*[local-name()="AddIntegers"]</eip:test>{code}
Elements which satisfy "test" are extracted and sent to the next service. <=> <AddIntegers> elements are split and each one is sent in one message.

h2. Test the EIP chain

\[ADD SCREENSHOTS\]
Deploy the SA containing the SU su-jsr181-MathOperations-provide. Deploy the SA&nbsp;sa-Eip-AggregatorSplitter.

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}
== Message 1 ==
{code:lang=xml|title=Message 1|theme=Default}
<AddIntegers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<integer1>1</integer1>
<integer2>2</integer2>
</AddIntegers>
{code}

== Response 1 ==
When everything is fine, you get this response, just saying the message was buffered :
{code:lang=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}


== Message 2 ==
We can continue to bufferize messages...
{code:lange=xml|title=Message 2|theme=Default}
<AddIntegers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<integer1>3</integer1>
<integer2>4</integer2>
</AddIntegers>
{code}

== Response 2 ==
<result xmlns="http://petals.ow2.org/petals-se-eip/aggregator">Aggregator: the content is buffered by the pattern</result>


== Message 3==
{code:lang=xml|title=Message 3|theme=Default}
<AddIntegers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<integer1>5</integer1>
<integer2>6</integer2>
</AddIntegers>
{code}

== Response 3 ==
<result xmlns="http://petals.ow2.org/petals-se-eip/aggregator">Aggregator: the content is buffered by the pattern</result> &nbsp;


== Message 4 ==
Let us send the trigger message :
{code:lang=xml|title=Message 4 - Trigger|theme=Default}
<AddIntegers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<equals/>
</AddIntegers>
{code}

== Response 4 ==
Now all messages are processed by MathOperations :
{code:lang=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:dlwmin="http://test.petalslink.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<returnMessage xmlns="">3</returnMessage>
</dlwmin:AddIntegersResponse>
<dlwmin:AddIntegersResponse xmlns:dlwmin="http://com.ebmwebsourcing.test" xmlns:dlwmin="http://test.petalslink.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<returnMessage xmlns="">7</returnMessage>
</dlwmin:AddIntegersResponse>
<dlwmin:AddIntegersResponse xmlns:dlwmin="http://com.ebmwebsourcing.test" xmlns:dlwmin="http://test.petalslink.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<returnMessage xmlns="">11</returnMessage>
</dlwmin:AddIntegersResponse>
h2. More about orchestration

Theory: Look *Look at other EIP patterns. Simple theory exercise: how would you do in this case....? [TODO] (15min) case....?*
Theory: Other orchestration ways: BPEL, SCA, JSR181 or POJO. More info in whitepaper. (5min)[http://www.w3schools.com/XPath/default.asp|http://www.w3schools.com/XPath/default.asp]

[TODO]

*Other orchestration ways: BPEL, SCA, JSR181 or POJO. More info in whitepaper*










{color:#000000}//*\[local-name()="AddIntegers"\]{color}
EIP : Good performances. But complicated and a bit "dirty old way" (for example, do not use WSDL)
BPEL: Based on XML and WSDL. Standard. Quite complicated to learn. Poorer performances.
SCA: The simplest. Java code based on WSDL.
POJO or JSR181: Needs advanced Java programmation.
Custom JBI Component: Needs lot of skills. Best performances. Hard to maintain.