Petals-SE-EIP

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

Changes (2)

View Page History

h3. Aggregator Pattern
{loremipsum:5}

*Enterprise Integration Pattern*

!aggregator.gif!
*Configuration of a Service Unit to provide a service (EIP) *
|| Parameter || Description || Default || Required by pattern ||
| eip | The name of the pattern to execute : {{aggregator}} | \- | All |
| test | XPath condition applied on the message to complete or not the sequence by the invocation of the targeted service | \- | aggregator \\
splitter \\
router \\
dynamic-router |
| aggregator-correlation | XPath condition that is applied on the incoming message to correlate them together | \- | aggregator |

The EIP Component receives source exchanges and correlates it to a SU deployed. The correlation is retrieved from an XPath expression specified in the SU parameter 'aggregator-correlation'. If the source exchange is {{InOut}} or {{InOptionalOut}}, a standard response is sent :

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

Once a source exchange matches the test, the target exchange, with a single, aggregated, content, is sent. The propagable source exchange properties are copied into the target exchange. The test is retrieved from an XPath expression specified in the SU parameter 'test'. The aggregated content is the result of a concatenation :

{code:xml}
<result xmlns="http://petals.ow2.org/petals-se-eip/aggregator">
...
</result>
{code}

The result of the target service is reported to the consumer of the source exchange matching the test.

An example of service unit configuration :

{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<!-- JBI descriptor for the PEtALS component "EIP"-->
<jbi:jbi version="1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jbi="http://java.sun.com/xml/ns/jbi"
xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"
xmlns:eip="http://petals.ow2.org/components/eip/version-2"
xmlns:test="http://petals.ow2.org/test">

<jbi:services binding-component="false">
<jbi:provides
interface-name="test:aggregator"
service-name="test:aggregatorService1"
endpoint-name="aggregatorService1Endpoint">
<petalsCDK:wsdl xsi:nil="true" />
<eip:eip>aggregator</eip:eip>
<eip:aggregator-correlation>/*[local-name()='helloworld']/text()</eip:aggregator-correlation>
<eip:test>boolean(/*[local-name()='helloworld' and namespace-uri()='http://petals.ow2.org/test3'])</eip:test>
</jbi:provides>

<jbi:consumes interface-name="test:aggregateProvider"
service-name="test:aggregateProviderService1"
endpoint-name="aggregateProviderService1Endpoint">
<petalsCDK:operation xmlns:petals="http://org.ow2.petals">petals:operation</petalsCDK:operation>
<petalsCDK:mep>InOnly</petalsCDK:mep>
</jbi:consumes>
</jbi:services>
</jbi:jbi>
{code}

h3. Scatter-Gather Pattern
{loremipsum:5}