mule advanced

15
Mule ESB –Advanced

Upload: drajesh-kumar

Post on 20-Jan-2017

367 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Mule advanced

Mule ESB –Advanced

Page 2: Mule advanced

Mule Message Structure

The Mule message is the data that passes through an application via one or more flows. It consists of two main parts:

The message header, which contains metadata about the message The message payload, which contains your business-specific data. 

Page 3: Mule advanced

Mule Message Properties and Variables

Message header consists of properties which provide useful information about the message

variables represent data about a message Properties have two main

scopes: inbound and outbound. Inbound Property

Page 4: Mule advanced

Mule Message Variables

Variables are user-defined metadata about a message.

Variables have three scopes: Flow variables apply only to the flow in

which they exist.

Session variables apply across all flows within the same application.

 

Page 5: Mule advanced
Page 6: Mule advanced

Outbound Endpoint

Mapping message headers to transport headers

Page 7: Mule advanced

Mapping transport headers to message headers

Inbound Endpoint

Page 8: Mule advanced

Transformation Types

3 Types of Transformers Type transformation - involves converting the ‘type’ of the message, for example; converting a byte stream to a string or converting a JMS Message to a Java object.

Message transformation involves converting the message itself,for example; converting a BookingRequest object into anAirlineTicket object.

Property Transformations involves the properties on a message.Each message may contain properties, usually related to the transport used. For example, a message sent to an

SMTP server would have ‘To’, ‘From’ and ‘CC’ properties

Page 9: Mule advanced

SPLITTER

A message splitter can be used to break down an outgoing message into parts and dispatch those parts over different endpoints configured on the router.

Page 10: Mule advanced

SplitterExample

<flow name="SplitterExampleFlow1" doc:name="SplitterExampleFlow1">        <http:inbound-endpoint exchange-pattern="request-response"

host="localhost" port="8081" doc:name="HTTP"/>          <splitter expression="#[xpath('//actor')]" doc:name="Splitter"

enableCorrelation="IF_NOT_SET"/>        <logger message="#[message.payload]" level="INFO"

doc:name="Logger"/>    </flow>

Page 11: Mule advanced

Mule Aggregator

Mule aggregators use the MULE_CORRELATION_ID and MULE_CORRELATION_GROUP_SIZE to reassemble a split message.

Page 12: Mule advanced

<flow name="aggregateLineItems"><jms:inbound-endpoint queue="lineitem.complete“ connector-ref="jmsConnector"/><collection-aggregator timeout="60000“ failOnTimeout="true" /><custom-transformerclass="com.prancingdonkey.transformer.LineItemsToOrderTransformer"/><component class="com.prancingdonkey.service.OrderProcessingService"/></flow>

Mule Aggregator Example

Page 13: Mule advanced

Resequencer

If fractions of the message are being processed in parallel in different servers, there's a good chance that they may take different lengths of time to be processed, and consequently fall out of order.

Page 14: Mule advanced

The Resequencer will wait for all of the messages in the group to arrive (keeping track of MULE_CORRELATION_ID and MULE_CORRELATION_GROUP_SIZE )

Reorder them according to their MULE_CORRELATION_SEQUENCE index.

The Resequencer outputs will be in distinct messages, 

Page 15: Mule advanced

THANK YOU