vm component

9
VM Component In Mule Demo

Upload: sunil-komarapu

Post on 18-Jan-2017

212 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Vm component

VM Component In Mule Demo

Page 2: Vm component

Abstract

• The main motto of this PPT is how to use VM component in our applications.

Page 3: Vm component

Introduction

• You can use the Java Virtual Machine (VM) transport for intra-JVM communication between Mule flows. This transport by default uses in-memory queues but can optionally be configured to use persistent queues..

Page 5: Vm component

• .mflow• <?xml version="1.0" encoding="UTF-8"?>

• <mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:vm="http://www.mulesoft.org/schema/mule/vm" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd

• http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.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/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">• <flow name="VMFlow1" doc:name="VMFlow1">• <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8087" path="VM"

doc:name="HTTP"/>• <logger message="--Main flow triggered " level="INFO" doc:name="Logger"/>• <vm:outbound-endpoint exchange-pattern="request-response" path="subflow" doc:name="VM"/>• </flow>• <flow name="VMFlow2" doc:name="VMFlow2">• <vm:inbound-endpoint exchange-pattern="request-response" path="subflow" doc:name="VM"/>• <logger message="--Hello world" level="INFO" doc:name="Logger"/>• </flow>• </mule>

Page 6: Vm component

• Output:

Page 7: Vm component

• Flow of execution:1. Service will trigger from browser with the

following URL “http://localhost:8087/VM”2. Service will display a message called ‘’ and

‘Hello world’

Page 8: Vm component

Features

• The in memory (VM) transport has two modes of operation: One for use with request-response and another for use with one-way endpoints.

• request-response:• When using request-response endpoints, messages are delivered directly from an

outbound vm endpoint to the inbound vm endpoint that is listening on the same path. This delivery is blocking and occurs in the same thread. If there is no inbound request-response VM endpoint in the same Mule application that is listening on this path, then dispatching a message from the outbound endpoint fails.

• one-way:• When using one-way endpoints, messages are delivered to the corresponding

inbound endpoint via a queue. This delivery is non-blocking. If there is no inbound one-wayendpoint in the same Mule application listening on this path, then, although dispatching of the message succeeds, the message remains in the queue. By default, this queue is in memory, but it is also possible to configure a persistent queue that uses the file system as its persistence mechanism.