[go: up one dir, main page]

100% found this document useful (1 vote)
910 views148 pages

Mulesoft Notes 1670516676

https://www.mulesoft.com/lp/form/mule-esb-community-edition • Mule ESB is a lightweight Java-based ESB that allows developers to connect applications together quickly and easily through declarative integration patterns like flow-based processing, message routing, transformation, and enrichment without writing lots of code. • Mule ESB uses a visual graphical interface called "Anypoint Studio" for designing integration flows and applications. It provides features like drag-and-drop visual design, debugging, testing, etc. • Mule ESB applications are deployed to a runtime server called "Mule Runtime" which provides the infrastructure to run and manage integration applications in production.

Uploaded by

Ankur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
910 views148 pages

Mulesoft Notes 1670516676

https://www.mulesoft.com/lp/form/mule-esb-community-edition • Mule ESB is a lightweight Java-based ESB that allows developers to connect applications together quickly and easily through declarative integration patterns like flow-based processing, message routing, transformation, and enrichment without writing lots of code. • Mule ESB uses a visual graphical interface called "Anypoint Studio" for designing integration flows and applications. It provides features like drag-and-drop visual design, debugging, testing, etc. • Mule ESB applications are deployed to a runtime server called "Mule Runtime" which provides the infrastructure to run and manage integration applications in production.

Uploaded by

Ankur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 148

MULESOFT

SAI KIRAN YALAKALA


Index
Anypoint Platform
Anypoint Studio
Introduction about (Design Center, Mule4 Structure (Set
(Package Explorer,
Mulesoft , API & API-LED Connectivity Exchange, Runtime Payload, Attributes &
Canvas, Palette &
Postman manager & API Set Variable )
Console)
Manager)

Connectors (FTP, SFTP,


Flows (Flow, Subflow & Automated & Manual
Flow reference MySQL, Salesforce & Transform Message
Private Flow) Project
AWS)

Error Handling (On-


Configuration error Continue, On
DataWeave () Choice Reutter Scatter Gather
properties Error Propagation &
Raise Error)
Drag and Drop tool Integration platform

Business data
connector
Acquired by Salesfore
(Communicates
on May’2018
between 2 or more
systems)
What is Mulesoft
Founded in 2006 by
Mule = Donkey + Horse
Ross Mason

Competitors : DELL
EAI Product
BOOMI, TIBCO etc…
What is
Integration
• Integration is the act of
bringing together smaller
components into a single
system that functions as one
• Integration is the process of
connecting multiple
enterprise systems, devices,
or applications to work as a
whole
• Milk + Water + Sugar+Tea
powder = Tea
• An API is a set of programming code that enables data
transmission between one software product and another. It
also contains the terms of this data exchange.
• Reusable piece of code
What is an API • Divided into 3 Layers
• System API
• Process API
• Experience API
What is an API specification

• API Specification is nothing but


how an API works
• What kind of request is
accepts
• What kind of Response it
returns
• Mandatory fields
• Schema validation
(Datatypes)
• Reliability pattern

API Life Cycle


API LED Connectivity
Architecture
API LED Connectivity – Real Time

• Manager need an employee details where employee id is 888777


• Logic: Browser->EmployeeID :888777-> Should be 6 digits ->DB
• Response: {
“name”: “Saikiran”,
“Skill”: “MuleSoft”
“Lcation”: Hyderabad
}
• Manager SAPI: Database logic (Select * from employees where employeeId=attributes.queryparams.id)
• Manager PAPI : Business logic (Should be 6 digits/Should not be empty/Only Numbers)
• Manager EAPI/XAPI: URL expose
Government
SAPI : Used to
fetch raw
details from
end system
ClientID & ClientSecret Enforcement

• Traits: To enforce the policies


• Defining Traits: Go to API
manager -> Policies -> Get
ClientID & ClientSecret
Policies
• https://docs.mulesoft.com/ap
i-manager/2.x/prepare-raml-
task
Publish to Exchange & • Create a new project & Import the RAML zip file
• If Manager-sapi api name is changed to manageritem-sapi in RAML
Import to Studio, • Goto: src/main/resources -> api ->sapi.raml > generate flow from
Changing Resource local rest api
• Change will be deployed – Check once
name
Government-
PAPI (RAML)
• Business logic is required in
PAPI
• The Business logic here is (if
Age > 60, “Eligible for
pension” else, “NOT”
Rest and SOAP web services
Invoking Rest API
External Rest API : https://dummy.restapiexample.com/api/v1/employees
Invoking SOAP API
• SOAP UI website:
https://www.soapui.org/docs/soap-and-
wsdl/working-with-wsdls/
• SOAP WSDL Example:
http://www.dneonline.com/calculator.asmx?wsdl
• Setup
• Connector: Web Service consume
• Configure with the URL example
• Service, Port and Address will come by
default
• Use (Add, Multiply, Divide) operator as of
requirement
Soap API : Mapping & Response
Passing variables in Postman via
queryParams but not in value
How to Print the result in Logger
Design Center - Design and develop API's

Anypoint Exchange - Place where we will be able to share,


discover api's and reusable assets

API Manager - Helps in Managing API's by invoking policies

Anypoint Runtime Manager - Where applications are deployed

Platform Access management -Configure access and permissions within


organization

Anypoint Monitoring/Visualizer-Provides monitoring and real-


time graphical representation of API's

Secret Manager - Place to store and control access to private


keys, passwords, cerificates
• Resource Name : Should be unique
Design Center: • Method : Get, Post, Put, Delete, Fetch
(Designing • Request : Contains Body, Resource
path, Uri path, Query param
RAML) • Response
• Http status: 200, 201, 202, 400, 401,
404, 500...
• Design center to Exchange
• Postman Testing
• Resource path, Query & Uri param
• Used to apply policies
• With Autodiscovery we cannot test the application with dummy ClientID & clientSecret

API Manager • What is Autodiscovery


• API Auto Discovery is used to connect Runtime manager deployed applications
with API created on the platform
• AutodiscoveryID is used to interact between Runtime manager and
API manager
Adding AutoDiscoveryID • Copy AutodiscoveryID (Eg: 18183173)
in Studio • Apply AutodiscoveryID in Studio inside Global elements -> Create ->
Search -> API Discovery -> API ID, FlowName (Always main flow)
• Client_id enforcement
• Rate limiting

Policies • IP blocklist
• IP whitelist
• Jwt validation
• Basic Auth
Most Used Policy : Cliend ID Enforcement
Applying client enforcement policy
Unregistered to Registered status via
cloudhub deployment
Runtime Manager: Deploy to cloudhub via Studio
AccessManagent: Get ClientID & ClientSecret
Pasting ClientID & ClientSecret in Runtime Properties
• Basic Auth -> Asks Username & Password
• ClientID Enforcement -> Requires client_id &
client_secret
Policies • Rate Limiting -> Send the set amount of
request for particular time period
&Uses • IP Whitelist : Having Access to the Ip’s which
are in the list
• IP Blacklist: Does not have access to the IP’s
mentions in the list
Additional about RAML & Status codes:

Creating folder for code simplicity (! include https://http.cat/ https://github.com/raml-org/raml-


FILENAME in Type -- application/json) ( Example status codes) spec/blob/master/versions/raml-10/raml-10.md/
(More about RAML)
Mule3 vs Mule4 Structure
What is Payload? (Part of Mule Message)
Payload is an actual message content. Payload can be overridden
What is
Attribute?
(Part of Mule
Message)
This provides Metadata such as
queryparams, File size etc. These
are immutable(Cannot be
changed)
What are Variables?
(Part of Mule event)
• These are which you can store some kind of
data or information and can be used accross
the application as long as you connect the
flow with flow-ref
• Set Payload:
• Used to Set the variable
• Set variable can be called in Payload
• Example: “My Name is ” ++ vars.name ++ “My id is ”
++vars.id
Anypoint • Link to Install:
https://www.mulesoft.com/platform/studio
Studio
Anypoint Studio Explanation

Package explorer

Canvas Palette

Console
Important points
about Mule
• Mulesoft is a Mavenized project
• All Mule xml’s are placed under
src/main/mule
• Other files can be placed under:
src/main/resources or src/test/resources
• Mule-artifact.json
• Each mule app xml has – Message
flow(graphical view), Global elements(all
config details), Configuration xml (xml
version or graphical view)
Flow is a message processing block that has its own
processing strategy and exception handling strategy.
Used in integration tasks, data processing, connecting
applications, event processing, etc.

Flow, Sub- Subflow always processes messages synchronously but

flow & inherits processing strategy and exception handling


strategy from the calling flow. It can be used to split
common logic and be reused by other flows.

Private flow Private flow does not have source define. It can be
synchronous or asynchronous based on the processing
strategy selected. Also they have their own exception
handling strategy. Allows you to define different
threading profile.
Flow Sub Flow Private Flow
Flow have Source, Process and A flow that do not have Source and A flow that have Source, Process &
Error handling part Error handling Error handling

We will give reference to other Having only Process part We will call it as private flow when
flows based on requirement source part is empty

Private-Flow

Sub-Flow
Flow
Automated vs Manual Project

Automated : Scheduler + Logger Manual: Listener+logger


Pom.xml
• The pom. xml file contains
the core information about a
project and its configuration
details including its
dependencies, build
directory, source directory,
test source directory, plugin,
goals etc. Maven reads the
pom. xml file, then executes
the goal.
Flow
reference
• Flow Reference breaks the
Mule application into discrete
and reusable units
• Flow Reference component in
a flow to direct Mule to send
a message to another flow for
processing
What is Set • This transformer sets the payload to whatever you define.
The payload can be a literal string or a Mule Expression.
Payload
Transform Message

• It also works same as Payload but it


will also do the work of set variable
• You can add n number of set
variables to Transform message but
only 1 payload can be added
Configuration properties
• Properties or values that are used for best practice to extract some values from
“property” files using corresponding key to avoid hard coding values
• We can extract property values from property file by 2 ways
• ${} :- Used at anywhere (Config/Dataweave)
• p(‘ ’) :- Used in Dataweave expression language scope
• Navigate to project -> src/main/resources -> RightClick -> File -> Create
File -> config.properties (File Name)
• After creating the file -> Go to Global elements -> Create -> configuration
How to create config properties -> Name the file name which you created (config.properties)
• P(): Can be used in Payload (eg: p(‘message’))
YAML
• YAML is a human-readable data-serialization
language. It is commonly used for
configuration files and in applications where
data is being stored or transmitted
• Yaml structure (http.port: 8081) where
config.properties are like (http.port = 8081)
DataWeave - Introduction
• DataWeave is a MuleSoft expression language for accessing and transforming data
• We can also access specific field inside payload
• We can extract all kind of Data and Transform it through DataWeave
• Transfer of data from one Format to another format is possible through DataWeave
• Eg: XML to JSON, CSV to JSON etc…

More about DataWeave:


https://www.tutorialspoint.com/mulesoft/mulesoft_dataweave_language.htm
DataWeave :- Preview Feature

Through preview we It will help us to check


It will help us reduce
can see how the whether if there are
time for debugging
output generates any syntax errors
and development
without execution before execution
Preview Through Sample Data
• Run the application
Preview through • Set the payload data in Transform message
Payload data • Request the data in postman to verify in response
Object & Array

• Object is denoted with in { },


and it is having key-value pair
• Array is denoted with [ ], It
have only values
• Link to Validate JSON:
• http://jsonviewer.stack.hu/
Transforming One data type to
Another
• In Mule3, We have different connectors to
convert data from one type to another
• In Mule4, we use DataWeave to achieve this
• Examples
• JSON to XML
• XML to CSV
• JSON to CSV
• XML to JSON
Json CSV

Xml
Java

Transformation Data Pictures


Commonly Used operators
map operators is used in Arrays
• Map & Map mapOject is used for Objects
Object
syntax: map operators cannot be used inObjects

map((value, index) ->{ }) mapObject cannot be used for Arrays


mapObject((value,key,in $: Gives the value
dex)->{ })

$$: Gives the index of the field

$$$: Gives the Key of the field


Map working
($ working)
Map with
(value,Index)

• When you got map and give ctrl + space,


It gives as below format
• a map ((value, index) ->{}
)
• Upper keyword is used for
Org, please check
MapObject : for Objects only
mapObject((key, value, index)->{})
Operator: Reduce

• Reduce function is used to reduce Array


into a single object
• Implemented only on arrays
Reduce: Array of Objects
Operator: Pluck

• Based on customer needs it plucks the


value (it will be in the format of Array of
Objects)
Pluck with joinBy
Operator: Flatten
Flatten combine all the data and gives the required data in sigle set of array
Flatten: Used to merge 2 or
more array of • Difference by using flatten kyword & Without flatten
objects/Objects into single keyword
array
Filter Key in
DataWeave

If we want to filter by key, value


-> eg : $.id>200
Note: We use filter for map( ) and
filterObject for mapObject( )
groupBy is used to group the array
groupBy in DataWeave according to the key(id, name,…)

By ID By name
orderBy is used to keep the array in
orderBy in DataWeave Order (Ascending/Descending)

Id Name
distinctBy : To remove duplicate records (Unique date)
If the id/location/name is empty
default : Not to store Null values then a default placeholder will be
set in that place
If-else in DataWeave

• If-else is a conditional
statement
• Syntax:
Eg: Status: if($.marks >= 60)
“Pass” else “Fail”
Task:- Learn about
• Link to Learn Functions/Methods:
DataWeave Functions • https://www.w3schools.com/java/java_methods.asp
and come back
TypeCasting
Get Time with
now(),now() as Date
& Required format
Now() “YYYY-MM-
DDTHH:SS:MS.SSSZ”
now() as “YYYY:MM:DD”
Date
Now() as “DD-MM-YY”
Date as
String{form
at:’dd-MM-
YY’}
Date Country Wide
• To call any “private flow” or Subflow we are using
Flow reference
• We can also call private flow component with
DataWeave function called Lookup
DataWeave • We cannot call Subflow with with DataWeave
function “Lookup”
Lookup • Syntax: Mule::lookup(“private-flow-name”,
“Payload can be passed here”)
• Link:
https://docs.mulesoft.com/dataweave/2.2/dw-
mule-functions-lookup
Scatter-Gather
• Scatter Gather sends the request message to
multiple targets concurrently, It collects responses
from various targets and aggregate them to a single
message
• Output payload is the combination all targets. And
each target output has (Payload+attribute)
• So its best practice to wrap every target within Try-
Block with On-Error-Continue, So you can handle
the errors and complete the process successfully
• The total time taken to process all targets is the
time took by single process (i.e Max 20secs)
• Use Try, On error continue to avoid errors. Because
if you get error even in one process, all processes
will be stopped
Scatter
Gather:
Example
Choice
Reutter
• The Choice router
dynamically routes messages
through a flow according to
a set of DataWeave
expressions that evaluate
message content
• Choice-reutter is like if-else
condition. It checks the
positive and negative
conditions and respond
accordingly
Connectors
Important Thing to remember while working
with connectors
File,SFTP, Database, Salesforce, any External web service etc… are some connectors

Gather the configuration details that are required while working with specific connector

See what is the request that particular system is accepting (Query param, Uri path, etc,.)

Check security that required to connect external system

Check what type of response returns back

Check what amount of time taking to get the response for particular request
Connector:
Request
• In http request, We are giving control
to another system (External) or API
and requesting them to give control
over that system
• Http Request is used to call other
Web-services
• Response is received from External
system
• It is placed in “Process” area of
private flow (or) Subflow
• We need to make sure on sending
proper inputs to http Request
components like URL, method, the
input payload and attributes like
query and uri param what ever web-
service is expecting
Request :
Mandatory
Config details
• Mandatory config details
• Protocol (Http/https)
• Method (Get/Post/Delete/Put)
• URL or Path : If you provide whole
URL, Then port base path are not
required. If you give path, then
host, port, path are necessary
• You can pass Body, headers, attributes,
queryParams in respective tabs
• In the case of Error coming from Web-
service, we are calling to be considered
as success, then have make changes in
response tab of Http Request and make
use of Success-status-code-validator
Some External
API’s we can use
• Weather API:
• https://openweathermap.or
g/api#current
• Employees Data:
• https://dummy.restapiexam
ple.com/api/v1/employees
• Configuring External API
Response of SetRequest is same as Rest API
Connector : Validation
VM Connector

• Virtual Machine (VM Connector) manages intra-app and inter-app communication through either transient or persistent asynchronous queues
• Transient Queues: Faster than persistent queues, But they are not reliable if system crashes
• Persistent Queues : Slower but reliable
• What is Transient Queue?
• Transient Queues is used to make process Faster to store data in the memory, But they are not reliable if system crashes
• Transient Queue is faster than persistent Queue
• What is Persistent Queue?
• Persistent Queues are slower while compared with the transient queues to store data in the memory, But they are reliable
• Persistent Queue is Slower than Transient Queue
• When we will use VM connector
• If we want to pass the messages to another flow through queue mechanism instead of Flow-ref, We will go with VM Connector
• Used Communicate between different apps with in Mule system
• When we want to distribute work across the system
• Publish : Used to publish the message to
VM connector: queue and receive message from queue
Publish, • Consume: Used to retrieve/Subscribe the
data from Publish after the end of the
Consume, main flow
• Publish Consume: Used in place of Publish
Listener, to retrieve/Subscribe the data from
Publish subscriber flow
• Note: Using Post method
consume
VM Config
Connector : Database
• Mandatory config details required
• Driver
• Host
• Port
• User
• Password
• Database/service name/ instance
• SQL Query text
Notes to Remember about Database

In Mule3, we used to have one database connector and we will be selecting


the kind of operation that we want. Like Select, Update, Insert & Delete

In Mule4, We have separate connector for each operation

You can test the connection if you want to check if connection is


successful

The “Output” type of select statement result is in “Array”


SQL Configuration
FTP and SFTP are one and same except
that SFTP used secured protocol
Notes to The way we connect the operations are
Remember all same for SFTP and FTP

about Requires credentials for SFTP


Database Host, Port, username & Password are
Mandatory configuration properties
Connector: File
• Mandatory Configuration details
• There are no particular configuration details
to configure a file as it does not have any
username & password
• But the configuration need to be created for
sure
• In Mule4, We have separate connectors for each
operation & You can check the connection whether
it is successful
• By Default, If we read a file, The file will not be
deleted
• You can extract the file name, size etc using
attributes
Email
connector
• Email connector is used to
send emails through smtp
protocol
• Dummy smtp address
- https://pepipost.com/
- Sign up the above url and got
to sandbox to use dummy
smtp server
Copy Copy : It is like copy and paste

Create
Some
Create Directory: Creating folder

Important Delete Delete: Delete Folder/File

operations List List: To bring all files in particular folder

in FTP/SFTP Move Move: It is like cut and paste(Move from one folder to another)

Read Read, Rename, Write…


File:Write Operation
It will write/Store what ever data coming from Database to a File
Trigger a flow when new file is created/Modified

Config

Output File Input File

Frequency setter
Auto Delete
• Run the flow
• Place a demo file in Input
Output • After Time Frequency it will move to the output folder & file
will be deleted from input folder
Difference between File/FTP/SFTP
File FTP SFTP

Used to Used to connect Used to connect


connect local remote system remote system
system securely

Not requires Winscp is Winscp, rebex


any setup required sftp server
software softwares are
required
• Create Salesforce Account : https://developer.salesforce.com/
Connector: Salesforce
Security token is Important to connect
-> Click on reset security token to receive it on mail
Salesforce
Config
• Mandatory Config details
required:
• Username
• Password
• Security token
• Auth url
• In Mule4, We have separate
connectors for each
operation & You can check
the connection whether it is
successful
Important points • Salesforce accepts application/java (i.e, Array of objects)
about salesforce
Go to Object
Manager
Look into the Fields closely and Apply the Fields present in Postman
Account
created in
Salesforce
Created Accounts in Salesforce Accounts
Select -> Used for select
records from the database

Queries in Upsert -> Used for inserting


Salesforce and updating the records

Delete -> Used to delete


the records
Connector : AWS-S3
• Mandatory Config details
• Access key
• Secret key
• Region
• Where can we get Access key and Secret
key
• Inside Profile -> Security Credentials ->
Access Key -> Displayed Over there (or)
Create New
• Aws cannot be found in modules, Install it
from Exchange
• We will call files as Bucket ins AWS
Error handling

• What is an error?
• An error occurs when an unexpected event
happens while processing
• What Is Error handling?
• Exception handling is nothing but handling the
errors while unexpected event happens while
processing
• Levels of error handling:
• Flow level error handling
• Connector level error handling
• Custom error handling
• Global error handling
At what levels we can do Error handling ?

• At project level using default error handler


• If we are not using any error handler, By default MuleSoft will handle the error and gives
proper error message to the user
• At project level using custom global error handler
• Mule4 error handling is very easy when compared with Mule3
• At flow level in exception handling using
• On error continue
• On error propagate
• Raise error
• With in flow or at process level using Try scope
Error handling : Important Notes

• When even an error occurs in the flow, An


error Object is Created
• It contains many properties
(error.description, error.errorType, etc,. )
• ErrorType is combination of Name space
and Identifier
• Eg: HTTP:UNAUTHORIZED
• Sub flow does not have any error handling
• Either it is propagate or continue, Mule
executes all the components with in the
Block
• How to identify the errors
• Mule4 have the excellent feature on
identifying the errors, By connectors
we can able to identify the errors
Rules to understand
Error handling

• See if anything is present in error


handling
• Even if there are on-error propagate
or continueblocks, see If that
particular errorType is handled
• If Not, Mule will use default error
handling
• If flow is called by any other flow,
then it will raise the error to calling
flow
• ON ERROR CONTINUE scope always returns a success response to the
Placing DB errors in next level
Error propagate & HTTP • ON ERROR PROPAGATE always propagates the error to the next level
and returns an error response to the next level.
errors in Error Continue
Creating Dummy HTTP request to see How the Error are handled by
Default Error handler
On Error Continue
• On placing HTTP:CONNECTIVITY error in
the error handling block it will handle
the error and triggers 200 response to
with the payload message
• On placing HTTP:OTHERS error in the
error handling block it cannot handle
the error and 500 response will be sent
with the error message
• On placing HTTP:CONNECTIVITY error in the error handling block it will
handle the error and triggers 500 response
On Error Propogate • It is going to the calling flow if there is any error to handle with in On-Error
Propogate
What happens if we • Placing a dummy URL in the request (HTTP:CONNECTIVITY)
Place On-error continue • In below case Propagate will execute and send 500 status to calling flow
&Propagate as above
On Error Propagate vs On Error Continue

On Error Propagate On Error continue


ON ERROR PROPAGATE always propagates ON ERROR CONTINUE scope always returns a success
the error to the next level and returns response to the next level
an error response to the next level
If the error is handled by using the On-Error On error continue will not raise the error back to the
Propagate, It will raise an error back to the calling calling flow and continue to next processor after
flow “Flow-Ref” and continue further process as it is

Capture error and stop the execution of the flow Captures the error and continues to the next level for
and returns the error code with 500.. Status code execution, It always returns 200 status code
Raise Error:

• We can have own type and Own


description in Raise Error
• It’s not like On-error (or) Continue to have
default error cases
• Eg: HTTP:NOT ALLOWED,
DB:CONNECTIVITY
• We cannot use the default error cases like
HTTP, DB etc…, It should be defined by us
Scopes in Mulesoft

First Until
Try Cache
successful successful

For each Message


Aync
scope enricher
Try scope
Try scope is used to handle the
errors within a connector level
• Cache scope will store previous requests and responses.
Cache scope • If there is any similar request, We will retrieve information
from memory(Object store) instead of calling target system
First Successfull
• The First Successful router iterates through a list of
configured processing routes until one of the routes
executes successfully. If any processing route fails execution
(throws an error), the router executes the next configured
route.
• It is also similar to the scatter gather but in case of scatter
gather parallel processing is done from a single source
system to multiple subscriber systems but in case of first
successful it executes the first successful record and ignores
the remaining
Until successful

• The Until Successful scope processes


the components within it until they
succeed or exhaust the maximum
number of retries. Until Successful runs
synchronously.
• Max Retries: Specifies the maximum
number of retries that are attempted
• Milliseconds Between Retries:
Specifies the minimum interval
between two attempts to process, in
milliseconds, Default value is 1 Min
FOR EACH
1. For each is used to process the records
synchronously(1 by 1). It is a single
threaded operation
2. Sample CSV files:
https://support.spatialkey.com/spatialkey-
sample-csv-data/
https://support.staffbase.com/hc/en-
us/articles/360007108391-CSV-File-Examples
3. POC: Take (On new or Update) file
connector -> take input as CSV file record ->
Transform it to Java -> Print records 1by1 in
logger(For each scope)
Batch Processing
• The messages are processed in batch
• In Mule3 we have 3 phasess in Batch job
• Input phase
• Process phase
• On complete phase
• Input phase is removed in Mule4, We have
only 2 phases
• Load and Dispatch phase
• Process phase
• On complete phase
Process only numbers

Real Time : Batch


processing
• Take an array of inputs in the Payload
(Eg: [1,2,"a",4,5,"b","c"])
• Drag the batch job
• We can add ‘n’ number batch steps in
Process records
• Processor: If there is any Logic like
inserting and upserting the DB we will
use processor
• Aggregator: The number of processes
inside data to be aggregated with
In 2nd Batch step
Mentioning only
failures(Strings)
• Note: In Batch_JOB,
Keep Max failed
records as some
number, Otherwise
failed records will not
be triggered to next
Batch_step. Ref:1.0.1
Ref 1.0.1
ActiveMQ

• Apache ActiveMQ is an open


source message broker written in
Java together with a full Java
Message Service (JMS) client
• If there are any records failing in
Batch processing we can put them
in queue and reprocess it again
• Configure JMS config in MQ
• We need to install tomcat Apache
ActiveMQ
https://activemq.apache.org/
• In Studio connector config Always username and Password
should be admin
To start ActiveMQ • In apache activemq download, Go to bin path-> enter cmd ->
server press activemq start to start the server
Difference between Queue and Topic

• Point to Point integration is


known as Queue (1-1)
• Publisher subscriber model is
known as Topic (1-n)
• A queue can have only one
consumer, whereas a topic can
have multiple subscribers.
ActiveMQ dashboard

• We have publish to publish the message to the


queue
• Consume is used to consume the published
queue in anther or same queue
• publishConsume is used to publish and
consume in the same queue
Munit is a developer level mock testing done by the developer
MUnits in Mule4 after complete development process and the below are the
operations to perform Munit testing
Munits Recorder & Manual testing

• Munit recorder is used to generate the


test validation automatically by
postman call. It is an automated testing
done by developer but pin Manual
testing every setup need to be done by
developer manually
Assert that • The Assert That event processor allows you to run assertions to validate the
state of a Mule event's content.
More Important topics
HTTP Status Scaling in
Postman Git Maven basics Worker
codes Mulesoft

Custom Deployment
Cloudhub vs Polling
connector / Domain project Load balancing models in
onpremises frequency
Custom policies mulesoft

Ajile and Message


Scrum master Implementation
$, $$, $$$ Waterfall Lookup in DW enricher &
and Sprint url
methodology Target Variable

DB API Kit router


Object store Rate limiting Splike control Proxy API
configurations
Important Things

Register training.mulesoft.com: https://training.mulesoft.com/home

Install Database (My SQL ) in Local machine

Link for MuleSoft Notes: https://www.tutorialspoint.com/mulesoft/index.htm

Link for Mulesoft Website: https://www.mulesoft.com/


Thank You
SAI KIRAN YALAKALA

You might also like