mule esb - intra application communication

18
Mule ESB – 3.6+ Tutorial on Intra application communication [email protected]

Upload: krishananth

Post on 29-Jul-2015

174 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Mule ESB - Intra application communication

Mule ESB – 3.6+

Tutorial on Intra application communication

[email protected]

Page 2: Mule ESB - Intra application communication

ObjectiveHow different Mule ESB applications

communicate with each other?What are the advantages?

Page 3: Mule ESB - Intra application communication

Pre-requisitesAnypoint Studio – January 2015 and laterMule ESB Runtime – 3.6.0 and aboveKnowledge on shared domainsKnowledge on VM connectorsKnowledge on Mule ESB Functional test case

suite

Page 4: Mule ESB - Intra application communication

Intra communication optionsUsing Http/SOAP (non performant due to

serialization)Using Http/REST (non performant due to

serialization)Using VM Connector – (performant - High 5 )

Page 5: Mule ESB - Intra application communication

ProcessCreate a shared domainCreate a shared VM connectorCreate a receiverCreate a sender (provider)Integrate all

Page 6: Mule ESB - Intra application communication

Step 1 – Create a shared domainCreate a shared domain project in StudioIn studio, go to File New Shared domain

projectSelect runtime Mule ESB 3.6.1 and click

Finish

Page 7: Mule ESB - Intra application communication

Step 1- Create a shared domain

Page 8: Mule ESB - Intra application communication

Step 2 – Define shared VM Connector In the shared domain project, create a new shared VM connector (make

sure you import correct schemas – see mule-domain-config.xml below)

<?xml version="1.0" encoding="UTF-8"?><domain:mule-domain xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:domain="http://www.mulesoft.org/schema/mule/ee/domain" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:vm="http://www.mulesoft.org/schema/mule/vm" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xsi:schemaLocation=" http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd http://www.mulesoft.org/schema/mule/ee/domain http://www.mulesoft.org/schema/mule/ee/domain/current/mule-domain-ee.xsd"> <!-- configure here resource to be shared within the domain --> <vm:connector name="my_shared_vm_connector" validateConnections="true" doc:name="VM"/>

</domain:mule-domain>

Page 9: Mule ESB - Intra application communication

Step 3 – Create Receiver ApplicationCreate a new Mule ESB application called

ReceiverApplication (child application)Create a flow which has VM Inbound

endpoint. Name the endpoint path as VM_INBOUND

Modify /src/main/app/mule-deploy.properties to refer to my-shared-domain

The connectors in domain are now available for your ReceiverApplication

Page 10: Mule ESB - Intra application communication

Step 3 - Image

Page 11: Mule ESB - Intra application communication

Step 4Create a Provider/Sender Mule ESB

applicationUpdate /src/main/app/deploy.properties touse

my-shared-domain.propertiesCreate a flow having VM Outbound endpointName the endpoint path as VM_INBOUNDRefer VM Outbound endpoint to use shared

connector (my-shared-vm-connector)

Page 12: Mule ESB - Intra application communication

Step 4 - Image

Page 13: Mule ESB - Intra application communication

Step 5 – Integrate allStart the Provider Application in StudioThe my-shared-domain, Provider application

and the Receiver application are started in Studio

Page 14: Mule ESB - Intra application communication

Step 5 - Image

Page 15: Mule ESB - Intra application communication

Step 6 - TestTest the application by opening the browser

to Http endpoint for provider applicationThe “Say Hello” payload is set from Provider

and is passed to Receiver using VM (intra memory communication)

Page 16: Mule ESB - Intra application communication

Step 6 – Image

Page 17: Mule ESB - Intra application communication

MiscellaneousShared VM connector works only in EE

editionIs fastest when compared to webservice or

REST based intra communication callsRequire shared domain to define a shared VM

connector

Page 18: Mule ESB - Intra application communication

Thank you!

[email protected]