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 (10)

View Page History
Run this tutorial (takes \~30 min) for Xpath : [http://www.w3schools.com/XPath/default.asp]


We will use XPath to control conditions on EIP patterns.

h2. Configure the Splitter

Configure EIP Splitter pattern (10min)
# Create a new EIP Technical service with the following configuration:
# JBI properties of the configuration service:
## Interface namespace: *[http://test.petalslink.com|http://test.petalslink.com*]*
## InterfaceName: *EipSplitterInterface*
## Service Namespace: *[http://test.petalslink.com|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:
## Select _su-jsr181-MathOperations-provide_ for automatic configuration.
# XPath Condition:
## *//\[local-name()="AddIntegers"\]*
# Additional Parameters
## Operation Namespace: *[http://test.petalslink.com|http://test.petalslink.com*]*
## Operation: *AddIntegers*
## Mep: *InOut*
# CDK properties
## Validate WSDL: *false* (there is no wsdl)

h2. Configure the Aggregator

Configure EIP Aggregator pattern (10min)
# Create a new EIP Technical service with the following configuration:
# JBI properties of the configuration service:
## 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: *Splitter*
## Aggregator Correlation: *boolean(/*\[local-name()="AddIntegers"\])\*
# Service Parameters:
## Select _su-EIP-EipSPlitter-provide_ for automatic configuration.
# XPath Condition:
## *boolean(/*\[local-name()="AddIntegers"\]/*\[local-name()="equals"\])*
# Additional Parameters
## Operation Namespace: *[http://test.petalslink.com]*
## Operation: *AnyOperationName* (since EipSplitter does not have an operation name)
## Mep: *InOut*
# CDK properties
## Validate WSDL: *false* (there is no wsdl)

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.
## 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. Review the chain

*EIP Agregator*


< eip:aggregator-correlation > boolean(/*\[local-name()="AddIntegers"\]) </ eip:aggregator-correlation >
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 >
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 >
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

Assemble the 2 SU in one SA and deploy (5min)
Test the Chain Aggregator=>Splitter=>MathOperations (15min)
\[ADD SCREENSHOTS\]

{code}
== Message 1 ==
<AddIntegers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<integer1>1</integer1>
<integer2>2</integer2>
</AddIntegers>

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


== Message 2 ==
<AddIntegers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<integer1>3</integer1>
<integer2>4</integer2>
</AddIntegers>

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


== Message 3==
<AddIntegers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<integer1>5</integer1>
<integer2>6</integer2>
</AddIntegers>

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


== Message 4 ==
<AddIntegers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<equals/>
</AddIntegers>

== Response 4 ==
<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/">
<returnMessage xmlns="">3</returnMessage>
</dlwmin:AddIntegersResponse>
<dlwmin:AddIntegersResponse xmlns:dlwmin="http://com.ebmwebsourcing.test" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<returnMessage xmlns="">7</returnMessage>
</dlwmin:AddIntegersResponse>
<dlwmin:AddIntegersResponse xmlns:dlwmin="http://com.ebmwebsourcing.test" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<returnMessage xmlns="">11</returnMessage>
</dlwmin:AddIntegersResponse>
</result>
{code}

h2. More about orchestration

Theory: Look at other EIP patterns. Simple theory exercise: how would you do in this case....? [TODO] (15min)
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]












{color:#000000}//*\[local-name()="AddIntegers"\]{color}