- S R I K A N T H N
Mule ESB Tutorial Part 2
6/20/2015Srikanth N
Mule ESB Elements
 Below are the Mule Elements which is defined in Anypoint Studio.
 1. Connectors
 2. Scopes
 3. Components
 4. Transformers
 5. Filters
 6. Flow Controls
 7. Error Handling
6/20/2015Srikanth N
Mule - Connectors
6/20/2015Srikanth N
 Mule Connectors receive or send message between Mule and one or more external
sources such as File, databases or Webservices.
 Mule Connectors will be placed at first component in flow (or) middle as message
processor that performs an operation in flow.
 Connectors in Mule are either endpoint-based or Operation-based.
 Endpoit-based connectors : VM, File, JMS, Jetty..etc
 Operation-based connectors : Salesforce, Twitter, Facebook, Http, Web Service,
Database ..etc.
 Example :
HTTP connector Configuration:
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
Mule - Components
 Mule Components are message processors which execute business logic on messages, but
which are mule specific code and we can drop a component.
 We can customize the components if required any additional validation on mule message.
 Mule components :
Scripting : Groovy, JavaScript, Python, Ruby.
WebService Components : REST and CXF
Others : Java, HTTP Static Resource Handler, Flow Reference., Logger..etc.
Example :
6/20/2015Srikanth N
Mule – Transformers
6/20/2015Srikanth N
 Mule Transformer altering the contents of the message properties, variables or
payload.
 Example : message source is receives date in XML format but downstream processor
expects a java object in which case we have XML-to-Object transformer to convert it
for you.
 We have enough pre-build transformers provided by MuleSoft, few are provided
below.
1. Java Object : JSON to Objuect and XML to Object.
2. Content : Append String, Prase Template and Expression.
3. SAP : SAP Object to XML and XML to SAP Object
4. Properties : Variable, Session Variable
---etc..
Additional MuleSoft is provided “DataMapper” which is most powerful Transformer whicj
will help developer life so easy
Mule – Transformers
6/20/2015Srikanth N
 Mule DataMapper : will take the input payload and mapped or changed with required
elements in out payload.
Mule –Scopes
6/20/2015Srikanth N
 Mule Scopes work to encapsulate other message processor so that they function as
single unit.
 Mule is having enough scope to process and fit our requirement, those are below.
Async - execute asynchronously and rest of the process execute in parallel.
Cache - Caches date produced by part of the flow.
ForEach – Spilts any type of collections apart into individual messages for processing,
and then aggregate them again in end of the flow.
Message Enricher – Append the information to a message.
Much more – Transactional, Until Successful, Poll, Composite Source…etc.
Mule –Filter
6/20/2015Srikanth N
 Mule Filters evaluates a message to determine whether it can proceed though a flow.
Example : you can use filter of you flow to reject any requests from a particular sources.
1. We can declare custom filter to validate specific requirement of client.
2. We can declare global filter to validate for all flows.
Mule Filters are :
Mule – Flow Controls or Routers
6/20/2015Srikanth N
 Mule Flow Controls act as splitters, resequencers and splitting messages into
individual items for processing.
 We do have many Flow controls provided by Mulesoft, moreover we can customazie.
 Mule flow controls are :
Mule – Exception Strategies
6/20/2015Srikanth N
 Mule Exception strategy will capture the exception when mule flow got failed to
process mule message.
 Mule Exception Strategies fall into two categories : System Exceptions and Message
Exceptions
 System Exceptions :
* During application start-up
* When a connection to external system fails.
 System Exceptions are not configuration in Mule, which will log the exception.
 Message Exception : Mule invokes a Messaging Exception Strategy whenever an
exception is thrown within a flow. Whenever a message is involved, exceptions are
handled by messaging exception strategies
Mule – Exception Strategies
6/20/2015Srikanth N
 Mule provided message strategies are :
 Message Exception Strategy
Chapter 2 End
 Any Questions?
(please post srikanthnallapa23@gmail.com)
6/20/2015Srikanth N

Mule ESB Tutorial Part 2

  • 1.
    - S RI K A N T H N Mule ESB Tutorial Part 2 6/20/2015Srikanth N
  • 2.
    Mule ESB Elements Below are the Mule Elements which is defined in Anypoint Studio.  1. Connectors  2. Scopes  3. Components  4. Transformers  5. Filters  6. Flow Controls  7. Error Handling 6/20/2015Srikanth N
  • 3.
    Mule - Connectors 6/20/2015SrikanthN  Mule Connectors receive or send message between Mule and one or more external sources such as File, databases or Webservices.  Mule Connectors will be placed at first component in flow (or) middle as message processor that performs an operation in flow.  Connectors in Mule are either endpoint-based or Operation-based.  Endpoit-based connectors : VM, File, JMS, Jetty..etc  Operation-based connectors : Salesforce, Twitter, Facebook, Http, Web Service, Database ..etc.  Example : HTTP connector Configuration: <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
  • 4.
    Mule - Components Mule Components are message processors which execute business logic on messages, but which are mule specific code and we can drop a component.  We can customize the components if required any additional validation on mule message.  Mule components : Scripting : Groovy, JavaScript, Python, Ruby. WebService Components : REST and CXF Others : Java, HTTP Static Resource Handler, Flow Reference., Logger..etc. Example : 6/20/2015Srikanth N
  • 5.
    Mule – Transformers 6/20/2015SrikanthN  Mule Transformer altering the contents of the message properties, variables or payload.  Example : message source is receives date in XML format but downstream processor expects a java object in which case we have XML-to-Object transformer to convert it for you.  We have enough pre-build transformers provided by MuleSoft, few are provided below. 1. Java Object : JSON to Objuect and XML to Object. 2. Content : Append String, Prase Template and Expression. 3. SAP : SAP Object to XML and XML to SAP Object 4. Properties : Variable, Session Variable ---etc.. Additional MuleSoft is provided “DataMapper” which is most powerful Transformer whicj will help developer life so easy
  • 6.
    Mule – Transformers 6/20/2015SrikanthN  Mule DataMapper : will take the input payload and mapped or changed with required elements in out payload.
  • 7.
    Mule –Scopes 6/20/2015Srikanth N Mule Scopes work to encapsulate other message processor so that they function as single unit.  Mule is having enough scope to process and fit our requirement, those are below. Async - execute asynchronously and rest of the process execute in parallel. Cache - Caches date produced by part of the flow. ForEach – Spilts any type of collections apart into individual messages for processing, and then aggregate them again in end of the flow. Message Enricher – Append the information to a message. Much more – Transactional, Until Successful, Poll, Composite Source…etc.
  • 8.
    Mule –Filter 6/20/2015Srikanth N Mule Filters evaluates a message to determine whether it can proceed though a flow. Example : you can use filter of you flow to reject any requests from a particular sources. 1. We can declare custom filter to validate specific requirement of client. 2. We can declare global filter to validate for all flows. Mule Filters are :
  • 9.
    Mule – FlowControls or Routers 6/20/2015Srikanth N  Mule Flow Controls act as splitters, resequencers and splitting messages into individual items for processing.  We do have many Flow controls provided by Mulesoft, moreover we can customazie.  Mule flow controls are :
  • 10.
    Mule – ExceptionStrategies 6/20/2015Srikanth N  Mule Exception strategy will capture the exception when mule flow got failed to process mule message.  Mule Exception Strategies fall into two categories : System Exceptions and Message Exceptions  System Exceptions : * During application start-up * When a connection to external system fails.  System Exceptions are not configuration in Mule, which will log the exception.  Message Exception : Mule invokes a Messaging Exception Strategy whenever an exception is thrown within a flow. Whenever a message is involved, exceptions are handled by messaging exception strategies
  • 11.
    Mule – ExceptionStrategies 6/20/2015Srikanth N  Mule provided message strategies are :  Message Exception Strategy
  • 12.
    Chapter 2 End Any Questions? (please post srikanthnallapa23@gmail.com) 6/20/2015Srikanth N