25
ESB Training Online

MuleSoft Fundamentals ESB Online Training Part 1

Embed Size (px)

Citation preview

Page 1: MuleSoft Fundamentals ESB Online Training Part 1

ESB Training Online

Page 2: MuleSoft Fundamentals ESB Online Training Part 1

Agenda Day 1

Key Concepts• Messages and Events• Mule Runtime• Flows• Mule Messages• Message Sources• Message Processors• DataSense• Mule Expression Language

Mule Message Structure• Messages Structure• Inbound properties• Outbound properties• Variables• Message Payload

Build a Mule Application • Build a Simple Project• Adding Loggers, Variables, Properties• Adding a Unit Test• Debugging Mule Application

Page 3: MuleSoft Fundamentals ESB Online Training Part 1

Messages and Events

Messages and events

Mule applications accepts and process messages through a series of message processors plugged together in a flow.

A message can be initiated by an event like • A consumer request from a mobile device• A change to a data in database• The creation of a new customer ID in a SaaS application

Page 4: MuleSoft Fundamentals ESB Online Training Part 1

Mule Runtime

A JVM Server that

Can handle many concurrent request for different Java (Mule) applications in a single JVM

Decouples point-to-point integrations by having all (non-Mule) applications talk to the bus (to a Mule runtime) instead directly to each other

Page 5: MuleSoft Fundamentals ESB Online Training Part 1

Flows A typical flow has

• A Message Source• Message Processors

A Mule Application can consist of• A Single flow• Multiple flows• Multiple flows connected

together

Flows

Page 6: MuleSoft Fundamentals ESB Online Training Part 1

Anypoint Studio

Creating Mule Application with Anypoint Studio

Anypoint Studio is an Eclipse-based integration development environment

Two-way editing between graphical and XML views Visual debugging Pre-built tooling to connect to

• Many popular services (Salesforce, Workday, Facebook, more!)• Many standard protocols (HTTP/HTTPS, FTP, File, SMTP, more!)• Any SOAP and RESTful API

Data transformation framework and language One click deployment of application Integration with maven for continous build process Embedded Mule Runtime

Page 7: MuleSoft Fundamentals ESB Online Training Part 1

Anypoint Studio Anatomy

Page 8: MuleSoft Fundamentals ESB Online Training Part 1

Walk Through DemoModule 01

Building a Mule Application

Page 9: MuleSoft Fundamentals ESB Online Training Part 1

Message Sources

The first building block of the most flows is a receiver that receives new messages and places them into a queue for processing

Message Sources are usually Anypoint Connectors

Connectors provides connectivity to external resources• Such as databases, protocols, or APIs• Standard protocols like HTTP, FTP, SMTP, AMQP• Third-party APIs like Salesforce, twitter, or google

Page 10: MuleSoft Fundamentals ESB Online Training Part 1

Message Processors

Connectors• Connects to an external

resources

Scopes• Wraps snippets of code to define

fine-grained behavior within a flow

Page 11: MuleSoft Fundamentals ESB Online Training Part 1

Message Processors

Components• Executes specific logic upon a

message, including custom logic in java, JavaScript, Groovy, Python or Ruby

Transformers• Modify the values of part of a

message

Page 12: MuleSoft Fundamentals ESB Online Training Part 1

Message Processors

Filters• Limit processing of messages

based on set criteria

Flow Controls• Direct messages through

different pathways in a application depending upon content or other criteria

Page 13: MuleSoft Fundamentals ESB Online Training Part 1

Message Processors

Error Handling• Handle any errors that occur

during messge processing

Page 14: MuleSoft Fundamentals ESB Online Training Part 1

Summary

Anypoint Studio can be used to build Mule applications for integrations

Mule applications accepts and process message through a series of message processors plugged together in a flow

Mule messages have inbound properties, outbound properties, a payload and attachments

Message processors include connectors, scope, components, transformers, filters, flow control, and error handling elements

Page 15: MuleSoft Fundamentals ESB Online Training Part 1

DataSense is Anypoint Studio’s ability to proactively discover metadata from internal and external resources

DataSense

Page 16: MuleSoft Fundamentals ESB Online Training Part 1

Add a Logger component to a flow and view its output in the Anypoint Studio console

Use the Anypoint Studio Visual Debugger

Use autocomplete when writing expressions in the Anypoint Studio Visual Editor

Other Ways to See Message Information

Page 17: MuleSoft Fundamentals ESB Online Training Part 1

Use MEL to access and evaluate the data in the payload, properties, and variables of a Mule Message

MEL is a lightweight, Mule-specific expression language

Accessible and usable from within virtually every message processor in Mule

Easy to use with autocomplete

Mule Expression Language

Page 18: MuleSoft Fundamentals ESB Online Training Part 1

#[]

Basic MEL Syntax

#[message]

#[message.payload]

Encapsulates all Mule Expressions

Holds a context object

Dot notation to access fields or methods

Page 19: MuleSoft Fundamentals ESB Online Training Part 1

Mule Message

Mule Message

Set from the Message Source

Added by Message Processor

The core of the Message

Ancillary info to the Message

Page 20: MuleSoft Fundamentals ESB Online Training Part 1

Properties

Inbound Properties

Set from Message Source Read-only access Persist throughout the flow

Reference in MEL as inboundProperties #[message.inboundProperties.foobar]

Outbound Properties

Added by Message Processor

Read/Write Access Can set, remove, copy

Reference in MEL as outboundProperties #[message.outboundProperties.foobar]

Page 21: MuleSoft Fundamentals ESB Online Training Part 1

Inbound Properties

Page 22: MuleSoft Fundamentals ESB Online Training Part 1

Outbound Properties

Page 23: MuleSoft Fundamentals ESB Online Training Part 1

Variables

Flow Variables

Variables tied to themessage event as it moves through the flows

Reference in MEL as flowVars #[flowVars.foobar]

Session Variables

Also tied to the message event as it moves through flows, but they are persisted across some but not all transport barriers

Reference in MEL as sessionVars #[sessionVars.foobar]

Page 24: MuleSoft Fundamentals ESB Online Training Part 1

Walk Through DemoModule 02

Adding Loggers, Variables, and Properties

Page 25: MuleSoft Fundamentals ESB Online Training Part 1

Summary

Mule messages have and how they have inbound properties, outbound properties, a payload and attachments

The best way to view message data is to add breakpoints to a flow and use the Mule debugger

Use the set payload transformer to set the payload

Use the property transformer to set, remove, or copy message outbound properties

Use the logger component to display data in the console

Use the Mule Expression Language (MEL) to write expressions #[]

Use variable transformer to create flow variables