mule esb - intra application communication

Post on 29-Jul-2015

174 Views

Category:

Technology

3 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Mule ESB – 3.6+

Tutorial on Intra application communication

ananth.krishnan@whishworks.com

ObjectiveHow different Mule ESB applications

communicate with each other?What are the advantages?

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

Intra communication optionsUsing Http/SOAP (non performant due to

serialization)Using Http/REST (non performant due to

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

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

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

Step 1- Create a shared domain

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>

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

Step 3 - Image

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)

Step 4 - Image

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

and the Receiver application are started in Studio

Step 5 - Image

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)

Step 6 – Image

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

Thank you!

Ananth.krishnan@whishworks.com

top related