SlideShare a Scribd company logo
Mule ESB - Connectors
File Connector
 The File connector allows Mule application to exchange files with a File system.
 It can be implemented as an inbound or an outbound endpoint.
File as an Inbound Endpoint
 If the File component is placed at the beginning of the flow, then it acts as an
inbound endpoint, which triggers the flow whenever it receives an incoming
file.
 File endpoint can be configured by providing the values on the fields of the
General tab of Properties editor.
Some of the important fields used for inbound endpoint configuration are :-
 Display Name – It is the general endpoint name.
 Path – This is the location of the file which is transferred into the flow.
 Move to Pattern – This is the pattern to be used when moving the file according to the
Move to Directory property
 Move to Directory – This is used to save a copy of the file on the Host machine when the
file is being dispatched to the next element.
 Polling Frequency – It checks how often the endpoint should check for the incoming
messages.
 File Age – Sets a minimum period a file must wait before it is processed.
File as an Outbound Endpoint
 If the File building block is placed at the middle or the end of the flow, then it acts
as the outbound endpoint, passing files to the connected file system.
 File outbound endpoint can also be configured just like inbound endpoint.
Some of the important fields used for outbound endpoint configuration are :-
 Path – For an outbound endpoint, this would be the directory on the connected file
system to which the file currently in the flow is written.
 File Name/Pattern – This property specifies a file name or pattern for naming files that
are sent from the File endpoint to the connected file system. If not set, it follows the
same pattern as the incoming files.
Advanced Tab fields
Apart from the configuration for Inbound and outbound properties in General Tab, there are
fields that could b configured in Advanced Tab as well. Some of the main fields are :-
 Address – To enter the address of the endpoint.
 Connector Endpoint – To add a new connection configuration or to edit an existing one.
 Comparator – To sort the incoming files
 Reverse Order – To reverse the normal comparison order
Connector Syntax
 A typical syntax for an inbound endpoint configured for reading files can be given
as :-
 <file:connector name = “input” fileAge = “500” autoDelete = “true”
pollingFrequency = “100” moveToDirectory = “/backup” />
Transformers for File
File Component includes several transformers for transforming the content of the file :-
 File to Byte Array Transformer – This element configures a transformer that reads
the content of a java.io.File into a byte array
 File to String Transformer - This element configures a transformer that reads the
content of a java.io.File into a String
Database Connector
 The Database connector allows to connect with almost any JDBC relational
database.
 Using Database connector, we can run diverse SQL operations on our database like
Select, Insert, Update, Delete, and even stored procedures.
 Database connector helps us perform pre defined as well as parametrized queries
and even DDL requests.
Configuration for Database Connector
To use Database connector, the basic configuration required is :-
 A database driver is required to connect with the database
 Configure a global database element where we can define the database’s location
and connection details, and advanced connection parameters like connection
pooling.
 Configure the database element in the mule flow which contains the query and the
reference to the Database Global element.
The Database connector provides out of the box support for 3 databases :
 MySQL
 Oracle
 Derby
For those databases, where Out of the box support is not provided, a Generic DB
Configuration is provided, and the driver can be added to the project.
Configuration Fields
Some of the important fields which should be configured are :-
 Database URL – To define the details of the Database to be connected with.
 Required Dependencies – To add the driver required.
 Enable Datasense(Optional) – It enables Mule to make use of message metadata at
run time.
 Connection Timeout – To define the amount of time the connection should remain
active.
 Config Reference – To identify any Global element if present
 Operation – To instruct the application for the type of operation to be performed
on the database.
 Type – To define the type of SQL statement we wish to use to submit queries to a
database :
 Parametrized – Mule replaces all MEL expressions inside the query with “?” to create
a prepared statement, then evaluates the MEL expressions.
E.g:- insert into employees where name = #[message.payload.name]
 Dynamic – Mule replaces all MEL expressions in the query with the result of the
expression evaluation, then sends the results to the database.
E.g:- select * from #[tablename]
 From Template- It enables to define a query once globally and then reuse the query
multiple times in the same application.
 Bulk Updates – The Database connector can run multiple SQL statements in bulk mode.
The individual SQL statements must be separated by semicolons and line breaks.
 Instead of writing a statement directly, we can also refer a file which contains multiple
statements with semicolons and line breaks.
 We can not perform Select operation as a part of bulk update, only Insert, Update and
Delete.
Using Mule with Web Services
Mule ESB allows different integration scenarios using web services :-
 Consuming existing web services.
 Building web services and exposing them to other applications.
 Creating a proxy/gateway to existing web services.
Web Service consumer
 While developing our applications, whenever we need to consume some external
SOAP services to acquire data, we can use a Web Service consumer.
 Using the information contained in service’s WSDL, this connector enables us to
configure a few details in order to establish the connection.
 The Web service consumer interfaces only with the SOAP services and not with the
REST.
To use the Web service consumer, we need to carry out the following 3 tasks :-
 Add the WSDL file of the service we need to consume.
 Embed a web service consumer in our Mule Flow.
 Configure the Global web service consumer element in which we reference the
service’s WSDL, enable Datasense and apply any security settings that the service
provider demands.
The studio auto populates the values of the fields in the Properties editor of the Web
service consumer :-
 Connector Configuration – With the name of the Global Web service consumer that we
just created.
 Operation – With the name of an operation that the Web service supports for its
consumers.
Building Web Services with CXF
Mule provides 3 ways to create web services :-
 Use the JAX WS front end to build a code first web service.
 Use the JAX WS front end to build a WSDL first web service.
 Creating a web service from simple POJOs.
To begin with writing a code first web service, the steps to be followed are :-
 We begin with writing the service interface. For example
package org.example;
import javax.jws.WebService;
@WebService
public interface HelloWorld {
String sayHi(String text);
}
The implementation for the above class may look like:-
package org.example;
import javax.jws.WebService;
@WebService(endpointInterface = “org.example.HelloWorld”,
serviceName = “HelloWorld”)
public class HelloWorldImpl implements HelloWorld {
public String sayHi(String text){
return “Hello ” + text;
}
}
Use case:
Once the application is deployed, we can generate the WSDL by appending ?wsdl at
the end of the end point URL.
 For e.g. http://localhost:8081/hello?wsdl
 This displays the WSDL generated by CXF
REST Component
 REST relies on HTTP for transport and uses HTTP methods to perform operations
on remote services.
 Mule ESB can be configured as a RESTful service endpoint. It provides a built-in
REST component based on the Jersey project.
 Mule ESB can be used as a publisher as well as consumer of RESTful Web Services.
Consuming a REST API
 We can consume a REST API from within a Mule application, by configuring an
HTTP Request Connector.
 A basic Mule application setup to consume a REST API contains :-
• One or more message processors configured to build the request.
• An HTTP request connector configured to call the REST API.
• One or more processors configured to accept and process the response.
 If a RAML file exists that describes the API we want to consume, then we can simply
reference it in the HTTP connector and it will expose the structure of the API at design
time.
 If we don’t have a RAML file, then we need to be aware of the structure of the API,
including any authentication requirements, the name of the resources we want to
access, and the methods supported for each resource.
 Some of the important information required are :-
• Authentication
• Base URL
• The type of input API expects (JSON, XML . . . . . etc)
• The type of output API produces.
• Error codes if any
Configuration
The first thing to be configured is the Global Connector element by providing the
basic information like
• Connector name
• Host
• Port
• Base Path
• API Configuration (if RAML is available)
Thank Q

More Related Content

What's hot

Connectors in mule
Connectors in muleConnectors in mule
Connectors in mule
Sindhu VL
 
Mule enricher
Mule enricher Mule enricher
Mule enricher
Ravinder Singh
 
Mule properties
Mule propertiesMule properties
Mule properties
Ravinder Singh
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
Praneethchampion
 
Mule system properties
Mule system propertiesMule system properties
Mule system properties
Ravinder Singh
 
Mulesoft file connector
Mulesoft file connectorMulesoft file connector
Mulesoft file connector
kumar gaurav
 
Mule advanced
Mule advancedMule advanced
Mule advanced
D.Rajesh Kumar
 
Mule Complete Training
Mule Complete TrainingMule Complete Training
Mule Complete Training
sourabh aggarwal
 
Mule enterprise service introduction
Mule enterprise service introductionMule enterprise service introduction
Mule enterprise service introduction
Son Nguyen
 
Mule rabbitmq
Mule rabbitmqMule rabbitmq
Mule rabbitmq
Praneethchampion
 
Mule rabbit mq
Mule rabbit mqMule rabbit mq
Mule rabbit mq
D.Rajesh Kumar
 
Mule esb
Mule esbMule esb
Mule esb
charan teja R
 
Mule concepts connectors
Mule concepts connectorsMule concepts connectors
Mule concepts connectors
kunal vishe
 
Mulehdfsconnector 160810122655
Mulehdfsconnector 160810122655Mulehdfsconnector 160810122655
Mulehdfsconnector 160810122655
ppts123456
 
Mule batch
Mule batchMule batch
Mule batch
Gandham38
 
Mule - HTTP Listener
Mule - HTTP ListenerMule - HTTP Listener
Mule - HTTP Listener
Ankush Sharma
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo
javeed_mhd
 
Mule Microsoft Service Bus
Mule Microsoft Service BusMule Microsoft Service Bus
Mule Microsoft Service Bus
Ankush Sharma
 
Splitters in mule
Splitters in muleSplitters in mule
Splitters in mule
vasanthii9
 
Introduction to mule esb
Introduction to mule esbIntroduction to mule esb
Introduction to mule esb
Khasim Cise
 

What's hot (20)

Connectors in mule
Connectors in muleConnectors in mule
Connectors in mule
 
Mule enricher
Mule enricher Mule enricher
Mule enricher
 
Mule properties
Mule propertiesMule properties
Mule properties
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
 
Mule system properties
Mule system propertiesMule system properties
Mule system properties
 
Mulesoft file connector
Mulesoft file connectorMulesoft file connector
Mulesoft file connector
 
Mule advanced
Mule advancedMule advanced
Mule advanced
 
Mule Complete Training
Mule Complete TrainingMule Complete Training
Mule Complete Training
 
Mule enterprise service introduction
Mule enterprise service introductionMule enterprise service introduction
Mule enterprise service introduction
 
Mule rabbitmq
Mule rabbitmqMule rabbitmq
Mule rabbitmq
 
Mule rabbit mq
Mule rabbit mqMule rabbit mq
Mule rabbit mq
 
Mule esb
Mule esbMule esb
Mule esb
 
Mule concepts connectors
Mule concepts connectorsMule concepts connectors
Mule concepts connectors
 
Mulehdfsconnector 160810122655
Mulehdfsconnector 160810122655Mulehdfsconnector 160810122655
Mulehdfsconnector 160810122655
 
Mule batch
Mule batchMule batch
Mule batch
 
Mule - HTTP Listener
Mule - HTTP ListenerMule - HTTP Listener
Mule - HTTP Listener
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo
 
Mule Microsoft Service Bus
Mule Microsoft Service BusMule Microsoft Service Bus
Mule Microsoft Service Bus
 
Splitters in mule
Splitters in muleSplitters in mule
Splitters in mule
 
Introduction to mule esb
Introduction to mule esbIntroduction to mule esb
Introduction to mule esb
 

Similar to Mule connectors-part 1

Mule ESB Components
Mule ESB Components Mule ESB Components
Mule ESB Components
pat_91
 
How to – wrap soap web service around a database
How to – wrap soap web service around a databaseHow to – wrap soap web service around a database
How to – wrap soap web service around a database
Son Nguyen
 
Introduction of ssis
Introduction of ssisIntroduction of ssis
Introduction of ssisdeepakk073
 
File Upload with RESP API
File Upload with RESP APIFile Upload with RESP API
File Upload with RESP API
Thiago Santana
 
Send email attachment using smtp in mule esb
Send email attachment using smtp  in mule esbSend email attachment using smtp  in mule esb
Send email attachment using smtp in mule esb
Anand kalla
 
Email configuration in mule esb
Email configuration in mule esbEmail configuration in mule esb
Email configuration in mule esb
Vamsi Krishna
 
Mule ESB Interview or Certification questions
Mule ESB Interview or Certification questionsMule ESB Interview or Certification questions
Mule ESB Interview or Certification questions
TechieVarsity
 
Top 50 MuleSoft interview questions
Top 50 MuleSoft interview questionsTop 50 MuleSoft interview questions
Top 50 MuleSoft interview questions
techievarsity
 
Email using mule
Email using muleEmail using mule
Email using mule
Manav Prasad
 
Mule esb
Mule esbMule esb
Send email attachment using smtp in mule esb
Send email attachment using smtp  in mule esbSend email attachment using smtp  in mule esb
Send email attachment using smtp in mule esb
princeirfancivil
 
Send email attachment using smtp in mule esb
Send email attachment using smtp  in mule esbSend email attachment using smtp  in mule esb
Send email attachment using smtp in mule esb
irfan1008
 
Send email attachment using smtp in mule esb
Send email attachment using smtp  in mule esbSend email attachment using smtp  in mule esb
Send email attachment using smtp in mule esb
Phaniu
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
RaviShankar Mishra
 
Web services
Web servicesWeb services
Web services
Thota Kumar
 
mulesoft
mulesoftmulesoft
mulesoft
Thota Kumar
 
Mule ESB
Mule ESBMule ESB
Mule ESB
Yura Nosenko
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
Sreekanth Kondapalli
 
introductionofssis-130418034853-phpapp01.pptx
introductionofssis-130418034853-phpapp01.pptxintroductionofssis-130418034853-phpapp01.pptx
introductionofssis-130418034853-phpapp01.pptx
YashaswiniSrinivasan1
 
Mule esb and_relevant_components
Mule esb and_relevant_componentsMule esb and_relevant_components
Mule esb and_relevant_components
Paaras Baru
 

Similar to Mule connectors-part 1 (20)

Mule ESB Components
Mule ESB Components Mule ESB Components
Mule ESB Components
 
How to – wrap soap web service around a database
How to – wrap soap web service around a databaseHow to – wrap soap web service around a database
How to – wrap soap web service around a database
 
Introduction of ssis
Introduction of ssisIntroduction of ssis
Introduction of ssis
 
File Upload with RESP API
File Upload with RESP APIFile Upload with RESP API
File Upload with RESP API
 
Send email attachment using smtp in mule esb
Send email attachment using smtp  in mule esbSend email attachment using smtp  in mule esb
Send email attachment using smtp in mule esb
 
Email configuration in mule esb
Email configuration in mule esbEmail configuration in mule esb
Email configuration in mule esb
 
Mule ESB Interview or Certification questions
Mule ESB Interview or Certification questionsMule ESB Interview or Certification questions
Mule ESB Interview or Certification questions
 
Top 50 MuleSoft interview questions
Top 50 MuleSoft interview questionsTop 50 MuleSoft interview questions
Top 50 MuleSoft interview questions
 
Email using mule
Email using muleEmail using mule
Email using mule
 
Mule esb
Mule esbMule esb
Mule esb
 
Send email attachment using smtp in mule esb
Send email attachment using smtp  in mule esbSend email attachment using smtp  in mule esb
Send email attachment using smtp in mule esb
 
Send email attachment using smtp in mule esb
Send email attachment using smtp  in mule esbSend email attachment using smtp  in mule esb
Send email attachment using smtp in mule esb
 
Send email attachment using smtp in mule esb
Send email attachment using smtp  in mule esbSend email attachment using smtp  in mule esb
Send email attachment using smtp in mule esb
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
 
Web services
Web servicesWeb services
Web services
 
mulesoft
mulesoftmulesoft
mulesoft
 
Mule ESB
Mule ESBMule ESB
Mule ESB
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
 
introductionofssis-130418034853-phpapp01.pptx
introductionofssis-130418034853-phpapp01.pptxintroductionofssis-130418034853-phpapp01.pptx
introductionofssis-130418034853-phpapp01.pptx
 
Mule esb and_relevant_components
Mule esb and_relevant_componentsMule esb and_relevant_components
Mule esb and_relevant_components
 

More from VirtusaPolaris

Mule m unit
Mule m unitMule m unit
Mule m unit
VirtusaPolaris
 
Mule debugging
Mule debuggingMule debugging
Mule debugging
VirtusaPolaris
 
Mule error handling
Mule error handlingMule error handling
Mule error handling
VirtusaPolaris
 
Mule core concepts
Mule core conceptsMule core concepts
Mule core concepts
VirtusaPolaris
 
Mule basics
Mule basicsMule basics
Mule basics
VirtusaPolaris
 
Mule flatfile-json
Mule flatfile-jsonMule flatfile-json
Mule flatfile-json
VirtusaPolaris
 
Mule copy book-tutorial
Mule copy book-tutorialMule copy book-tutorial
Mule copy book-tutorial
VirtusaPolaris
 
Mule xml java
Mule xml javaMule xml java
Mule xml java
VirtusaPolaris
 
Mule ESB - Demo
Mule ESB - DemoMule ESB - Demo
Mule ESB - Demo
VirtusaPolaris
 

More from VirtusaPolaris (9)

Mule m unit
Mule m unitMule m unit
Mule m unit
 
Mule debugging
Mule debuggingMule debugging
Mule debugging
 
Mule error handling
Mule error handlingMule error handling
Mule error handling
 
Mule core concepts
Mule core conceptsMule core concepts
Mule core concepts
 
Mule basics
Mule basicsMule basics
Mule basics
 
Mule flatfile-json
Mule flatfile-jsonMule flatfile-json
Mule flatfile-json
 
Mule copy book-tutorial
Mule copy book-tutorialMule copy book-tutorial
Mule copy book-tutorial
 
Mule xml java
Mule xml javaMule xml java
Mule xml java
 
Mule ESB - Demo
Mule ESB - DemoMule ESB - Demo
Mule ESB - Demo
 

Recently uploaded

Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 

Recently uploaded (20)

Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 

Mule connectors-part 1

  • 1. Mule ESB - Connectors
  • 2. File Connector  The File connector allows Mule application to exchange files with a File system.  It can be implemented as an inbound or an outbound endpoint.
  • 3. File as an Inbound Endpoint  If the File component is placed at the beginning of the flow, then it acts as an inbound endpoint, which triggers the flow whenever it receives an incoming file.  File endpoint can be configured by providing the values on the fields of the General tab of Properties editor.
  • 4.
  • 5. Some of the important fields used for inbound endpoint configuration are :-  Display Name – It is the general endpoint name.  Path – This is the location of the file which is transferred into the flow.  Move to Pattern – This is the pattern to be used when moving the file according to the Move to Directory property  Move to Directory – This is used to save a copy of the file on the Host machine when the file is being dispatched to the next element.  Polling Frequency – It checks how often the endpoint should check for the incoming messages.  File Age – Sets a minimum period a file must wait before it is processed.
  • 6. File as an Outbound Endpoint  If the File building block is placed at the middle or the end of the flow, then it acts as the outbound endpoint, passing files to the connected file system.  File outbound endpoint can also be configured just like inbound endpoint.
  • 7.
  • 8. Some of the important fields used for outbound endpoint configuration are :-  Path – For an outbound endpoint, this would be the directory on the connected file system to which the file currently in the flow is written.  File Name/Pattern – This property specifies a file name or pattern for naming files that are sent from the File endpoint to the connected file system. If not set, it follows the same pattern as the incoming files.
  • 9. Advanced Tab fields Apart from the configuration for Inbound and outbound properties in General Tab, there are fields that could b configured in Advanced Tab as well. Some of the main fields are :-  Address – To enter the address of the endpoint.  Connector Endpoint – To add a new connection configuration or to edit an existing one.  Comparator – To sort the incoming files  Reverse Order – To reverse the normal comparison order
  • 10.
  • 11. Connector Syntax  A typical syntax for an inbound endpoint configured for reading files can be given as :-  <file:connector name = “input” fileAge = “500” autoDelete = “true” pollingFrequency = “100” moveToDirectory = “/backup” />
  • 12. Transformers for File File Component includes several transformers for transforming the content of the file :-  File to Byte Array Transformer – This element configures a transformer that reads the content of a java.io.File into a byte array  File to String Transformer - This element configures a transformer that reads the content of a java.io.File into a String
  • 13. Database Connector  The Database connector allows to connect with almost any JDBC relational database.  Using Database connector, we can run diverse SQL operations on our database like Select, Insert, Update, Delete, and even stored procedures.  Database connector helps us perform pre defined as well as parametrized queries and even DDL requests.
  • 14.
  • 15. Configuration for Database Connector To use Database connector, the basic configuration required is :-  A database driver is required to connect with the database  Configure a global database element where we can define the database’s location and connection details, and advanced connection parameters like connection pooling.  Configure the database element in the mule flow which contains the query and the reference to the Database Global element.
  • 16.
  • 17. The Database connector provides out of the box support for 3 databases :  MySQL  Oracle  Derby For those databases, where Out of the box support is not provided, a Generic DB Configuration is provided, and the driver can be added to the project.
  • 18. Configuration Fields Some of the important fields which should be configured are :-  Database URL – To define the details of the Database to be connected with.  Required Dependencies – To add the driver required.  Enable Datasense(Optional) – It enables Mule to make use of message metadata at run time.  Connection Timeout – To define the amount of time the connection should remain active.  Config Reference – To identify any Global element if present  Operation – To instruct the application for the type of operation to be performed on the database.
  • 19.  Type – To define the type of SQL statement we wish to use to submit queries to a database :  Parametrized – Mule replaces all MEL expressions inside the query with “?” to create a prepared statement, then evaluates the MEL expressions. E.g:- insert into employees where name = #[message.payload.name]  Dynamic – Mule replaces all MEL expressions in the query with the result of the expression evaluation, then sends the results to the database. E.g:- select * from #[tablename]  From Template- It enables to define a query once globally and then reuse the query multiple times in the same application.
  • 20.
  • 21.  Bulk Updates – The Database connector can run multiple SQL statements in bulk mode. The individual SQL statements must be separated by semicolons and line breaks.  Instead of writing a statement directly, we can also refer a file which contains multiple statements with semicolons and line breaks.  We can not perform Select operation as a part of bulk update, only Insert, Update and Delete.
  • 22. Using Mule with Web Services Mule ESB allows different integration scenarios using web services :-  Consuming existing web services.  Building web services and exposing them to other applications.  Creating a proxy/gateway to existing web services.
  • 23. Web Service consumer  While developing our applications, whenever we need to consume some external SOAP services to acquire data, we can use a Web Service consumer.  Using the information contained in service’s WSDL, this connector enables us to configure a few details in order to establish the connection.  The Web service consumer interfaces only with the SOAP services and not with the REST.
  • 24. To use the Web service consumer, we need to carry out the following 3 tasks :-  Add the WSDL file of the service we need to consume.  Embed a web service consumer in our Mule Flow.  Configure the Global web service consumer element in which we reference the service’s WSDL, enable Datasense and apply any security settings that the service provider demands.
  • 25.
  • 26. The studio auto populates the values of the fields in the Properties editor of the Web service consumer :-  Connector Configuration – With the name of the Global Web service consumer that we just created.  Operation – With the name of an operation that the Web service supports for its consumers.
  • 27. Building Web Services with CXF Mule provides 3 ways to create web services :-  Use the JAX WS front end to build a code first web service.  Use the JAX WS front end to build a WSDL first web service.  Creating a web service from simple POJOs.
  • 28. To begin with writing a code first web service, the steps to be followed are :-  We begin with writing the service interface. For example package org.example; import javax.jws.WebService; @WebService public interface HelloWorld { String sayHi(String text); }
  • 29. The implementation for the above class may look like:- package org.example; import javax.jws.WebService; @WebService(endpointInterface = “org.example.HelloWorld”, serviceName = “HelloWorld”) public class HelloWorldImpl implements HelloWorld { public String sayHi(String text){ return “Hello ” + text; } }
  • 31. Once the application is deployed, we can generate the WSDL by appending ?wsdl at the end of the end point URL.  For e.g. http://localhost:8081/hello?wsdl  This displays the WSDL generated by CXF
  • 32. REST Component  REST relies on HTTP for transport and uses HTTP methods to perform operations on remote services.  Mule ESB can be configured as a RESTful service endpoint. It provides a built-in REST component based on the Jersey project.  Mule ESB can be used as a publisher as well as consumer of RESTful Web Services.
  • 33. Consuming a REST API  We can consume a REST API from within a Mule application, by configuring an HTTP Request Connector.  A basic Mule application setup to consume a REST API contains :- • One or more message processors configured to build the request. • An HTTP request connector configured to call the REST API. • One or more processors configured to accept and process the response.
  • 34.
  • 35.  If a RAML file exists that describes the API we want to consume, then we can simply reference it in the HTTP connector and it will expose the structure of the API at design time.  If we don’t have a RAML file, then we need to be aware of the structure of the API, including any authentication requirements, the name of the resources we want to access, and the methods supported for each resource.  Some of the important information required are :- • Authentication • Base URL • The type of input API expects (JSON, XML . . . . . etc) • The type of output API produces. • Error codes if any
  • 36. Configuration The first thing to be configured is the Global Connector element by providing the basic information like • Connector name • Host • Port • Base Path • API Configuration (if RAML is available)
  • 37.