Petals Getting started - day 5 - EIP Orchestration

Last tested with
  • Petals ESB 3.1
  • Petals Studio 1.1.0
  • Petals SE RMI 1.1.1
  • Petals BC SOAP 4.0.2
  • Petals Webconsole 2.0.3
  • Tomcat 6.0.29
  • JDK 6 update 20
  • Petals SE Jsr181 1.1.2

Added in this tutorial :

  • Petals SE EIP 2.4.3
This tutorial is based on [EIP Buffer complex use case].

Definition of our integration process

Today you will bufferize messages, to process them all in one by MathOperations.

You will use Enterprise Integration Patterns (EIP, see below for explanations) to create this process :

  • Several messages are sent to an EIPAggregator pattern, which bufferize all incoming messages.
  • Trigger message is sent to EipAggregator.
  • EipAggregator sends an aggregated message to EipSPlitter.
  • EipSplitter splits the aggregated message back into multiple messages.
  • EipSPlitter sends the multiple messages to the operation AddIntegers on the service MathOperations.
  • MathOperations.AddIntegers processes the messages and send you the responses.
Macro Error Cannot find the diagram with these parameters:
name: Petals RMI-EIP-JSR181
version:
pageName: Bufferize operations with EIP
pageId:
spaceKey: petalsesb

Little bit of theory: EIP (Enterprise Integration Patterns) and XPath

What is EIP ?
A set of design patterns for enterprise application integration.
What is Agregator pattern ?

What is Splitter Pattern ?

What is XPath ?

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.

Configure the Splitter

  1. Create a new EIP Technical service with the following configuration:
  2. JBI properties of the configuration service:
    1. Interface namespace: http://test.petalslink.com
    2. InterfaceName: EipSplitterInterface
    3. Service Namespace: http://test.petalslink.com
    4. Service Name: EipSplitter
    5. End-point Name: EipSplitterEndpoint
  3. Project Name and Location:
    1. Project Name: su-EIP-EipSplitter-provide
  4. Specific Component properties:
    1. Eip: Splitter
  5. Service Parameters:
    1. Select su-jsr181-MathOperations-provide for automatic configuration.
  6. XPath Condition:
    1. //[local-name()="AddIntegers"]
  7. Additional Parameters
    1. Operation Namespace: http://test.petalslink.com
    2. Operation: AddIntegers
    3. Mep: InOut
  8. CDK properties
    1. Validate WSDL: false (there is no wsdl)

Configure the Aggregator

  1. Create a new EIP Technical service with the following configuration:
  2. JBI properties of the configuration service:
    1. Interface namespace: http://test.petalslink.com
    2. InterfaceName: EipAggregatorInterface
    3. Service Namespace: http://test.petalslink.com
    4. Service Name: EipAggregator
    5. End-point Name: EipAggregatorEndpoint
  3. Project Name and Location:
    1. Project Name: su-EIP-EipAggregator-provide
  4. Specific Component properties:
    1. Eip: Splitter
    2. Aggregator Correlation: boolean(/[local-name()="AddIntegers"])*
  5. Service Parameters:
    1. Select su-EIP-EipSPlitter-provide for automatic configuration.
  6. XPath Condition:
    1. boolean(/[local-name()="AddIntegers"]/[local-name()="equals"])
  7. Additional Parameters
    1. Operation Namespace: http://test.petalslink.com
    2. Operation: AnyOperationName (since EipSplitter does not have an operation name)
    3. Mep: InOut
  8. CDK properties
    1. Validate WSDL: false (there is no wsdl)

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).

  1. Create a new Service Assembly.
    1. Name: sa-Eip-AggregatorSplitter
  2. Add the two EIP Service-Units you created, and confirm
  3. Fast-export the Service Assembly for Petals.
  4. Deploy in Petals ESB.

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.

Test the EIP chain

[ADD SCREENSHOTS]

== 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>

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

//*[local-name()="AddIntegers"]

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.