# Create a new EIP Technical service with the following configuration:
|| Parameter name \\ || Value \\ ||
|| JBI propertie || ||
| Interface namespace | [http://test.petalslink.com] |
| InterfaceName | EipSplitterInterface |
| Service Namespace | [http://test.petalslink.com] |
| Service Name | EipSplitter |
| End-point Name | EipSplitterEndpoint |
|| Project Name and Location || ||
| Project Name | su-EIP-EipSplitter-provide |
|| Specific Component properties || ||
| Eip | Splitter |
|| Service Parameters || ||
| Service Parameters | _Select "su-jsr181-MathOperations-provide" _ | Auto-configuration |
|| XPath Condition || ||
| XPath Condition | //*\[local-name()="AddIntegers"\] |
|| Additional Parameters || ||
| Operation Namespace | [http://test.petalslink.com] |
| Operation | AddIntegers |
| Mep | InOut |
|| CDK properties || ||
| Validate WSDL | false | There is no wsdl |
h2. Configure the Aggregator
# Create a new EIP Technical service with the following configuration:
|| Parameter name \\ || Value \\ ||
|| JBI propertie || ||
| Interface namespace | [http://test.petalslink.com] |
| InterfaceName | EipAggregatorInterface |
| Service Namespace | [http://test.petalslink.com] |
| Service Name | EipAggregator |
| End-point Name | EipAggregatorEndpoint |
|| Project Name and Location || ||
| Project Name | su-EIP-EipAggregator-provide |
|| Specific Component properties || ||
| Eip | Aggregator |
| Aggregator Correlation \\ | boolean(/*\[local-name()="AddIntegers"\]) |
|| Service Parameters || ||
| Service Parameters | _Select "_{_}su-EIP-EipSPlitter-provide{_}_" _ |
|| XPath Condition || ||
| XPath Condition | {noformat:nopanel=true}boolean(/*[local-name()="AddIntegers"\]/*[local-name()="equals"]){noformat} |
|| Additional Parameters || ||
| Operation Namespace | [http://test.petalslink.com] |
| Operation | AddIntegers |
| Mep | InOut |
|| CDK properties || ||
| Validate WSDL | false |
h2. Create and deploy an EIP Service Assembly
There is a tight-coupling between both EIP. Assembling them in one single SA can be a good idea (especially with EIP, which can chain lots of patterns, each requiring a different SU).
# Create a new Service Assembly.
|| Service Assembly || ||
| Name | sa-Eip-AggregatorSplitter |
# Add the two EIP Service-Units you created, and confirm.
# Fast-export the Service Assembly for Petals.
# Deploy in Petals ESB.
h2. Understand XPath expressions
*What is XPath ?*
Run this tutorial (takes \~30 min) for Xpath : [http://www.w3schools.com/XPath/default.asp|http://www.w3schools.com/XPath/default.asp]
Now try to understand the XPath expressions we used. If you use EIP later, it is essential to understand and be able to write XPath.
*EIP Agregator conditions*
# Elements which satisfy "aggregator-correlation" are aggregated
{code:lang=xml}<eip:aggregator-correlation>boolean(/*[local-name()="AddIntegers"])</eip:aggregator-correlation>{code}
Elements inside <AddIntegers> will be aggregated.
# When "test" is true, aggregated message is sent.
{code:lang=xml}<eip:test>boolean(/*[local-name()="AddIntegers"]/*[local-name()="equals"])</eip:test>{code}
When <AddIntegers> contains the <equals> element, the aggregated message is sent to the next service, and buffer cleared.
*EIP Splitter conditions*
# Elements which satisfy "test" are extracted and sent to the next service.
{code:lang=xml}<eip:test>//*[local-name()="AddIntegers"]</eip:test>{code}
<AddIntegers> elements are split and sent one by one.
h2. Test the EIP chain
# Deploy the SA containing the SU su-jsr181-MathOperations-provide.
# Deploy the SA sa-Eip-AggregatorSplitter.
# Send messages from webconsole, with InOut MEP (message exchange pattern).
# Send the trigger message.
{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}
{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}
{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}
{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}
{code:lang=xml|title=Message 4 - Trigger|theme=Default}
<AddIntegers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<equals/>
</AddIntegers>
{code}
{code:lang=xml|title=Response message|theme=Default}
<result xmlns="http://petals.ow2.org/petals-se-eip/splitter">
<dlwmin:AddIntegersResponse 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://test.petalslink.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<returnMessage xmlns="">7</returnMessage>
</dlwmin:AddIntegersResponse>
<dlwmin:AddIntegersResponse xmlns:dlwmin="http://test.petalslink.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<returnMessage xmlns="">11</returnMessage>
</dlwmin:AddIntegersResponse>
</result>
{code}
h2. More about orchestration
*Look at other EIP patterns. Simple theory exercise: how would you do in this case....?*
[TODO]