mule filters, scopes, and routers

12
Mule Filters, Scopes, and Routers

Upload: cong-thanh-nguyen

Post on 12-Apr-2017

261 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Mule filters, scopes, and routers

Mule Filters, Scopes, and Routers

Page 2: Mule filters, scopes, and routers

Filters

• Evaluate a message to determine whether it can proceed through a flow

• Simplest filters implement basic logic operators (and, or and not)

• Simple elements can be combined in various ways to specify complex logical conditions

Page 3: Mule filters, scopes, and routers

Filters - Example

• Use a filter near the beginning of your flow to reject any requests from a particular range of IP addresses

• Use a filter to reject any messages with a particular payload, or with a null payload

Page 4: Mule filters, scopes, and routers

Scopes

• Encapsulate other message processors so that they function as a single unit

• Wrap several message processors together to form a transactional unit, so that they succeed or fail to process a message together, thus ensuring accurate updating of a database

Page 5: Mule filters, scopes, and routers

Scopes - Example

• Wrap several message processors together within a cache scope to store the result of their processing for reuse

• Wrap a single message processor within a message enricher scope to add to a message payload without manipulating the original contents

Page 6: Mule filters, scopes, and routers

Routers

• Rirect or otherwise control messages within a flow• Controls act as splitters, resequencers, or

aggregators, splitting messages into individual items for processing, resequencing message content, or aggregating split messages

• Evaluating a message’s payload, properties, or variables, then routing to the message down a particular "pathway" according to those contents

Page 7: Mule filters, scopes, and routers

Routers- Example

• Use a choice flow control to examine part of a message payload

• Route the message to the first "pathway" for which the set condition evaluates to true, such as where an order exceeds $5,000

Page 8: Mule filters, scopes, and routers

Example - Expression Filter

Page 9: Mule filters, scopes, and routers

Example - Expression Filter

Page 10: Mule filters, scopes, and routers

Example - Message Enricher and Cache Scope

Page 11: Mule filters, scopes, and routers

Example - Choice Router

Page 12: Mule filters, scopes, and routers

Question and answer