SlideShare a Scribd company logo
1 of 55
Mule ESB Components
karthik
File Component
• 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 Component
• 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 prject.
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.
Other Features• Some other important features of Database connector are :-
• Executing DDL – DDL is a kind of request used for creating, altering
or deleting the tables.
When using DDL, we can use only Dynamic Queries which may or
may not have MEL expressions.
• 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;
}
}
• 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)
• Next we configure the Connector’s Properties editor. The basic fields
to be configured are :-
• Name
• Connector Configuration
• URL Path
• Method
• Parameters (if any)
• If the API requires additional security requirements, redirects, or a
specific content type encoding, the HTTP connector supports
additional configuration to manage these details.
Designing a new API
• A RAML (RESTful API Modeling Language) editor is a simple and easy way to design APIs.
• RAML is a simple and practical language for describing APIs.
• A RAML file includes the following elements :-
• Root
• Documentation
• Resources
• Methods
• Pattern based reusable elements
• A RAML file can be written in any text editor, but it is recommended to
write it in the API Designer.
• It consists of a RAML editor with an embedded RAML API console that
proactively provides suggestions, error feedback and a built-in live testing
environment.
• It also contains a context aware shelf at the bottom of the Designer
which displays a list of the components we can enter.
• The operations to be depicted in the API can be mapped to resources here.
Each operation maps to an individual resource.
• For e.g. For a T-Shirt ordering API, we can have the following resources
• /products
• /orders
• Orders each have a nested {orderId}/status, as a sub resource
• /products :
• displayName : Products
• /orders :
• displayName : Orders
• /{orderId}/status :
• displayName : status
• After adding resources, we can add the methods accordingly.
• Since we need the customers to see the available products and not
modify them, we can add a GET method for this resource.
• The customers can place orders, so I this case we can add a POST
method.
• Also the customers may want to see the status of their order, so we can
add a GET method for /{orderId}/status resource.
• The responses component on the shelf specifies which response could
be expected of these methods :-
• 200 (OK)
• 500 (server error)
• 400 (client error)
• It’s a good practice to provide response examples in the API. Using
these examples, developers can build their consuming application
accordingly.
• To ensure that the requests sent to the resources are valid, we can also
add schema so that they follow the same structure. Both these things
can be added in the body – application/json element.
• At the same level, we can even add the queryParameters element
element with its attributes.
• Next the API can be tested by turning on the Mocking Service and
checking in the API console.
DataWeave Component
• DataWeave is a new feature of version 3.7 which replaces the DataMapper in
the previous versions.
• The DataWeave language is a simple, powerful tool to query and transform
data inside of mule. It can be used in 2 different ways :-
• We can graphically map the fields by dragging and dropping them, as in
DataMapper, or
• We can use its powerful JSON like language to make transformations as fast
as possible.
Using the DataWeave Component
• We can use the DataWeave Component, by placing a Transform Message element in our
flow. This generates a .dwl transformation file that stores our code and is packaged within
our Mule application.
• The Properties editor displays two sides for this element :-
• The left side displays a Graphical editor where we can drag and drop the elements to create
mapping between them.
• The right side displays the DataWeave code editor, where we can use the DataWeave
language to make transformations.
• Both the regions represent the same transformation and any change done to one is reflected
on the other.
• Input Structure :-
• If the elements in the flow expose their metadata, then this
information will be readily available in the Transform Message
component. If they don’t then we can configure it by editing their
Metadata tab.
• Configuring the CSV Reader :-
• Some input formats like CSV allow us to define a reader with specific
properties like :
• Header : Boolean that defines if the first line is a header
• Separator : character that separates fields
• Quotes : character that defines quoted text
• Escape : character that escapes quotes
Examples of DataWeave Transformation
• We can consider a basic example of conversion from JSON to XML
• Input :-
{
“title” : “Java 8 in action”,
“author” : “Mario Fusco”,
“year” : “2014”
}
• Transform :-
% dw 1.0
% output application/xml
---------
{
order : {
type : “Book”,
title : payload.title
details : “By $(payload.author) ($(payload.year))”
}
}
• Output :-
<? Xml version = ‘1.0’ encoding = ‘UTF-8’ ? >
<order>
<type>Book</type>
<title>Java 8 in action</title>
<details>By Mario Fusco (2014)</details>
</order>

More Related Content

What's hot

Mule dataweave
Mule dataweaveMule dataweave
Mule dataweaveSon Nguyen
 
Muletransformers
MuletransformersMuletransformers
Muletransformersvijaynerd
 
JDBC Connectivity Model
JDBC Connectivity ModelJDBC Connectivity Model
JDBC Connectivity Modelkunj desai
 
Mule concepts transformers
Mule concepts transformersMule concepts transformers
Mule concepts transformerskunal vishe
 
Lunacloud's Compute RESTful API - Programmer's Guide
Lunacloud's Compute RESTful API - Programmer's GuideLunacloud's Compute RESTful API - Programmer's Guide
Lunacloud's Compute RESTful API - Programmer's GuideLunacloud
 
Anypoint mq queues and exchanges
Anypoint mq queues and exchangesAnypoint mq queues and exchanges
Anypoint mq queues and exchangesSon Nguyen
 
Stored Procedure With In Out Parameters in Mule 3.6
 Stored Procedure With In Out Parameters in Mule 3.6 Stored Procedure With In Out Parameters in Mule 3.6
Stored Procedure With In Out Parameters in Mule 3.6Sashidhar Rao GDS
 
Email configuration in mule esb
Email configuration in mule esbEmail configuration in mule esb
Email configuration in mule esbVamsi Krishna
 
Mule Message Chunk Aggregator
Mule Message Chunk AggregatorMule Message Chunk Aggregator
Mule Message Chunk AggregatorAnkush Sharma
 
De-Mystifying the Apache Phoenix QueryServer
De-Mystifying the Apache Phoenix QueryServerDe-Mystifying the Apache Phoenix QueryServer
De-Mystifying the Apache Phoenix QueryServerJosh Elser
 
Real-time Big Data Analytics Engine using Impala
Real-time Big Data Analytics Engine using ImpalaReal-time Big Data Analytics Engine using Impala
Real-time Big Data Analytics Engine using ImpalaJason Shih
 
Mule Script Transformer
Mule Script TransformerMule Script Transformer
Mule Script TransformerAnkush Sharma
 

What's hot (18)

Mule dataweave
Mule dataweaveMule dataweave
Mule dataweave
 
Muletransformers
MuletransformersMuletransformers
Muletransformers
 
JDBC Connectivity Model
JDBC Connectivity ModelJDBC Connectivity Model
JDBC Connectivity Model
 
Mule jdbc
Mule   jdbcMule   jdbc
Mule jdbc
 
Mule concepts transformers
Mule concepts transformersMule concepts transformers
Mule concepts transformers
 
Lunacloud's Compute RESTful API - Programmer's Guide
Lunacloud's Compute RESTful API - Programmer's GuideLunacloud's Compute RESTful API - Programmer's Guide
Lunacloud's Compute RESTful API - Programmer's Guide
 
Anypoint mq queues and exchanges
Anypoint mq queues and exchangesAnypoint mq queues and exchanges
Anypoint mq queues and exchanges
 
Stored Procedure With In Out Parameters in Mule 3.6
 Stored Procedure With In Out Parameters in Mule 3.6 Stored Procedure With In Out Parameters in Mule 3.6
Stored Procedure With In Out Parameters in Mule 3.6
 
Spring integration
Spring integrationSpring integration
Spring integration
 
Mule esb messages
Mule esb messagesMule esb messages
Mule esb messages
 
Email configuration in mule esb
Email configuration in mule esbEmail configuration in mule esb
Email configuration in mule esb
 
Lecture19
Lecture19Lecture19
Lecture19
 
Mule Message Chunk Aggregator
Mule Message Chunk AggregatorMule Message Chunk Aggregator
Mule Message Chunk Aggregator
 
De-Mystifying the Apache Phoenix QueryServer
De-Mystifying the Apache Phoenix QueryServerDe-Mystifying the Apache Phoenix QueryServer
De-Mystifying the Apache Phoenix QueryServer
 
Web technology Unit-I Part D - message format
Web technology Unit-I  Part D - message formatWeb technology Unit-I  Part D - message format
Web technology Unit-I Part D - message format
 
Real-time Big Data Analytics Engine using Impala
Real-time Big Data Analytics Engine using ImpalaReal-time Big Data Analytics Engine using Impala
Real-time Big Data Analytics Engine using Impala
 
Mule Script Transformer
Mule Script TransformerMule Script Transformer
Mule Script Transformer
 
Mule esb
Mule esbMule esb
Mule esb
 

Viewers also liked

Mulefundamentals 160503050909
Mulefundamentals 160503050909Mulefundamentals 160503050909
Mulefundamentals 160503050909ppts123456
 
Anypointconnectordevkit 160816041722
Anypointconnectordevkit 160816041722Anypointconnectordevkit 160816041722
Anypointconnectordevkit 160816041722ppts123456
 
Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Peter R. Egli
 
Flowsinmule 160517130818
Flowsinmule 160517130818Flowsinmule 160517130818
Flowsinmule 160517130818ppts123456
 

Viewers also liked (6)

Wsdl
WsdlWsdl
Wsdl
 
Mulefundamentals 160503050909
Mulefundamentals 160503050909Mulefundamentals 160503050909
Mulefundamentals 160503050909
 
Wsdl
WsdlWsdl
Wsdl
 
Anypointconnectordevkit 160816041722
Anypointconnectordevkit 160816041722Anypointconnectordevkit 160816041722
Anypointconnectordevkit 160816041722
 
Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)
 
Flowsinmule 160517130818
Flowsinmule 160517130818Flowsinmule 160517130818
Flowsinmule 160517130818
 

Similar to Muleesbcomponents1 160625154208

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 databaseSon Nguyen
 
(ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service (ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service BIOVIA
 
Mule esb and_relevant_components
Mule esb and_relevant_componentsMule esb and_relevant_components
Mule esb and_relevant_componentsPaaras Baru
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.pptkstalin2
 
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...Amazon Web Services
 
Migrating very large site collections
Migrating very large site collectionsMigrating very large site collections
Migrating very large site collectionskiwiboris
 
FOSDEM19 MySQL Component Infrastructure
FOSDEM19 MySQL Component InfrastructureFOSDEM19 MySQL Component Infrastructure
FOSDEM19 MySQL Component InfrastructureGeorgi Kodinov
 
UNIT3 DBMS.pptx operation nd management of data base
UNIT3 DBMS.pptx operation nd management of data baseUNIT3 DBMS.pptx operation nd management of data base
UNIT3 DBMS.pptx operation nd management of data baseshindhe1098cv
 
Migrating Very Large Site Collections (SPSDC)
Migrating Very Large Site Collections (SPSDC)Migrating Very Large Site Collections (SPSDC)
Migrating Very Large Site Collections (SPSDC)kiwiboris
 
web-servers3952 (1)qwjelkjqwlkjkqlwe.ppt
web-servers3952 (1)qwjelkjqwlkjkqlwe.pptweb-servers3952 (1)qwjelkjqwlkjkqlwe.ppt
web-servers3952 (1)qwjelkjqwlkjkqlwe.ppt20521742
 
session and cookies.ppt
session and cookies.pptsession and cookies.ppt
session and cookies.pptJayaprasanna4
 
Case Study For Replication For PCMS
Case Study For Replication For PCMSCase Study For Replication For PCMS
Case Study For Replication For PCMSShahzad
 
Spring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applicationsSpring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applicationsmichaelaaron25322
 
File Upload with RESP API
File Upload with RESP APIFile Upload with RESP API
File Upload with RESP APIThiago Santana
 

Similar to Muleesbcomponents1 160625154208 (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
 
(ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service (ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service
 
Mule esb and_relevant_components
Mule esb and_relevant_componentsMule esb and_relevant_components
Mule esb and_relevant_components
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.ppt
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.ppt
 
Servlet1.ppt
Servlet1.pptServlet1.ppt
Servlet1.ppt
 
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
 
SOA_BPM_12c_launch_event_SOA_track_deepdive_developerproductivityandperforman...
SOA_BPM_12c_launch_event_SOA_track_deepdive_developerproductivityandperforman...SOA_BPM_12c_launch_event_SOA_track_deepdive_developerproductivityandperforman...
SOA_BPM_12c_launch_event_SOA_track_deepdive_developerproductivityandperforman...
 
Migrating very large site collections
Migrating very large site collectionsMigrating very large site collections
Migrating very large site collections
 
FOSDEM19 MySQL Component Infrastructure
FOSDEM19 MySQL Component InfrastructureFOSDEM19 MySQL Component Infrastructure
FOSDEM19 MySQL Component Infrastructure
 
UNIT3 DBMS.pptx operation nd management of data base
UNIT3 DBMS.pptx operation nd management of data baseUNIT3 DBMS.pptx operation nd management of data base
UNIT3 DBMS.pptx operation nd management of data base
 
Migrating Very Large Site Collections (SPSDC)
Migrating Very Large Site Collections (SPSDC)Migrating Very Large Site Collections (SPSDC)
Migrating Very Large Site Collections (SPSDC)
 
Unit 2 oracle9i
Unit 2  oracle9i Unit 2  oracle9i
Unit 2 oracle9i
 
web-servers3952 (1)qwjelkjqwlkjkqlwe.ppt
web-servers3952 (1)qwjelkjqwlkjkqlwe.pptweb-servers3952 (1)qwjelkjqwlkjkqlwe.ppt
web-servers3952 (1)qwjelkjqwlkjkqlwe.ppt
 
session and cookies.ppt
session and cookies.pptsession and cookies.ppt
session and cookies.ppt
 
Case Study For Replication For PCMS
Case Study For Replication For PCMSCase Study For Replication For PCMS
Case Study For Replication For PCMS
 
Spring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applicationsSpring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applications
 
Srilekha mule esb
Srilekha mule esbSrilekha mule esb
Srilekha mule esb
 
File Upload with RESP API
File Upload with RESP APIFile Upload with RESP API
File Upload with RESP API
 

More from ppts123456

4 150915033746-lva1-app6892
4 150915033746-lva1-app68924 150915033746-lva1-app6892
4 150915033746-lva1-app6892ppts123456
 
Mulehdfsconnector 160810122655
Mulehdfsconnector 160810122655Mulehdfsconnector 160810122655
Mulehdfsconnector 160810122655ppts123456
 
Mulethenewtechnology 12549172699166-phpapp03-160421133841
Mulethenewtechnology 12549172699166-phpapp03-160421133841Mulethenewtechnology 12549172699166-phpapp03-160421133841
Mulethenewtechnology 12549172699166-phpapp03-160421133841ppts123456
 
Deployingmuleapplications 160903085602
Deployingmuleapplications 160903085602Deployingmuleapplications 160903085602
Deployingmuleapplications 160903085602ppts123456
 
Mulesoftanypointplatformintro
MulesoftanypointplatformintroMulesoftanypointplatformintro
Mulesoftanypointplatformintroppts123456
 
2016 08-08 ecology and environment
2016 08-08 ecology and environment2016 08-08 ecology and environment
2016 08-08 ecology and environmentppts123456
 
Algorithm analysis and efficiency
Algorithm analysis and efficiencyAlgorithm analysis and efficiency
Algorithm analysis and efficiencyppts123456
 

More from ppts123456 (9)

4 150915033746-lva1-app6892
4 150915033746-lva1-app68924 150915033746-lva1-app6892
4 150915033746-lva1-app6892
 
Mulehdfsconnector 160810122655
Mulehdfsconnector 160810122655Mulehdfsconnector 160810122655
Mulehdfsconnector 160810122655
 
Mulethenewtechnology 12549172699166-phpapp03-160421133841
Mulethenewtechnology 12549172699166-phpapp03-160421133841Mulethenewtechnology 12549172699166-phpapp03-160421133841
Mulethenewtechnology 12549172699166-phpapp03-160421133841
 
Deployingmuleapplications 160903085602
Deployingmuleapplications 160903085602Deployingmuleapplications 160903085602
Deployingmuleapplications 160903085602
 
Mulesoftanypointplatformintro
MulesoftanypointplatformintroMulesoftanypointplatformintro
Mulesoftanypointplatformintro
 
Mule overview
Mule overviewMule overview
Mule overview
 
2016 08-08 ecology and environment
2016 08-08 ecology and environment2016 08-08 ecology and environment
2016 08-08 ecology and environment
 
Algorithm analysis and efficiency
Algorithm analysis and efficiencyAlgorithm analysis and efficiency
Algorithm analysis and efficiency
 
E procureppt
E procurepptE procureppt
E procureppt
 

Recently uploaded

Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 

Recently uploaded (20)

Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 

Muleesbcomponents1 160625154208

  • 2. File Component • 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.
  • 14. Database Component • 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.
  • 15.
  • 16. 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.
  • 17.
  • 18. • 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 prject.
  • 19. 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.
  • 20. • 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.
  • 21. Other Features• Some other important features of Database connector are :- • Executing DDL – DDL is a kind of request used for creating, altering or deleting the tables. When using DDL, we can use only Dynamic Queries which may or may not have MEL expressions.
  • 22.
  • 23. • 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.
  • 24.
  • 25. 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.
  • 26. 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.
  • 27. • 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.
  • 28.
  • 29. • 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.
  • 30. 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.
  • 31. • 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); }
  • 32. • 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; } }
  • 33.
  • 34. • 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
  • 35. 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.
  • 36. 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.
  • 37.
  • 38. • 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
  • 39. 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)
  • 40.
  • 41. • Next we configure the Connector’s Properties editor. The basic fields to be configured are :- • Name • Connector Configuration • URL Path • Method • Parameters (if any) • If the API requires additional security requirements, redirects, or a specific content type encoding, the HTTP connector supports additional configuration to manage these details.
  • 42.
  • 43. Designing a new API • A RAML (RESTful API Modeling Language) editor is a simple and easy way to design APIs. • RAML is a simple and practical language for describing APIs. • A RAML file includes the following elements :- • Root • Documentation • Resources • Methods • Pattern based reusable elements
  • 44. • A RAML file can be written in any text editor, but it is recommended to write it in the API Designer. • It consists of a RAML editor with an embedded RAML API console that proactively provides suggestions, error feedback and a built-in live testing environment. • It also contains a context aware shelf at the bottom of the Designer which displays a list of the components we can enter.
  • 45. • The operations to be depicted in the API can be mapped to resources here. Each operation maps to an individual resource. • For e.g. For a T-Shirt ordering API, we can have the following resources • /products • /orders • Orders each have a nested {orderId}/status, as a sub resource • /products : • displayName : Products • /orders : • displayName : Orders • /{orderId}/status : • displayName : status
  • 46. • After adding resources, we can add the methods accordingly. • Since we need the customers to see the available products and not modify them, we can add a GET method for this resource. • The customers can place orders, so I this case we can add a POST method. • Also the customers may want to see the status of their order, so we can add a GET method for /{orderId}/status resource. • The responses component on the shelf specifies which response could be expected of these methods :- • 200 (OK) • 500 (server error) • 400 (client error)
  • 47. • It’s a good practice to provide response examples in the API. Using these examples, developers can build their consuming application accordingly. • To ensure that the requests sent to the resources are valid, we can also add schema so that they follow the same structure. Both these things can be added in the body – application/json element. • At the same level, we can even add the queryParameters element element with its attributes. • Next the API can be tested by turning on the Mocking Service and checking in the API console.
  • 48.
  • 49. DataWeave Component • DataWeave is a new feature of version 3.7 which replaces the DataMapper in the previous versions. • The DataWeave language is a simple, powerful tool to query and transform data inside of mule. It can be used in 2 different ways :- • We can graphically map the fields by dragging and dropping them, as in DataMapper, or • We can use its powerful JSON like language to make transformations as fast as possible.
  • 50. Using the DataWeave Component • We can use the DataWeave Component, by placing a Transform Message element in our flow. This generates a .dwl transformation file that stores our code and is packaged within our Mule application. • The Properties editor displays two sides for this element :- • The left side displays a Graphical editor where we can drag and drop the elements to create mapping between them. • The right side displays the DataWeave code editor, where we can use the DataWeave language to make transformations. • Both the regions represent the same transformation and any change done to one is reflected on the other.
  • 51.
  • 52. • Input Structure :- • If the elements in the flow expose their metadata, then this information will be readily available in the Transform Message component. If they don’t then we can configure it by editing their Metadata tab. • Configuring the CSV Reader :- • Some input formats like CSV allow us to define a reader with specific properties like : • Header : Boolean that defines if the first line is a header • Separator : character that separates fields • Quotes : character that defines quoted text • Escape : character that escapes quotes
  • 53. Examples of DataWeave Transformation • We can consider a basic example of conversion from JSON to XML • Input :- { “title” : “Java 8 in action”, “author” : “Mario Fusco”, “year” : “2014” }
  • 54. • Transform :- % dw 1.0 % output application/xml --------- { order : { type : “Book”, title : payload.title details : “By $(payload.author) ($(payload.year))” } }
  • 55. • Output :- <? Xml version = ‘1.0’ encoding = ‘UTF-8’ ? > <order> <type>Book</type> <title>Java 8 in action</title> <details>By Mario Fusco (2014)</details> </order>