SlideShare a Scribd company logo
1 of 4
Mule ESB
How to convert from CSV to Json
In this tutorial we will be creating an easy csv to json converter using mule esb.
Let’s begin creating a simple flow with file reader component, in order to trigger the
transformation:
Now let’s create a csv file under the folder src/main/resources/input named test.csv in
this way:
Now it’s time to configure the File component to read the csv file just created:
Let’s recall that Polling Frequency is the
interval of polling the input path (in
millliseconds)
Now we are ready to put the transformation using the DataWeave component
Click on the «Edit sample data» button and paste the content
of the csv file in order to see the preview, not before having set
the output to application/json and made the payload the
output:
Finally, put an Object to String transformer and a Logger to see the results:
[[db_test].converter_testFlow.stage1.02] org.mule.api.processor.LoggerMessageProcessor: [
{
"Billing Street": "111 Boulevard Hausmann",
"Billing City": "Paris",
"Billing Country": "France",
"Billing State": "",
"Name": "Dog Park Industries",
"BillingPostalCode": "75008"
},
{
"Billing Street": "400 South St",
"Billing City": "San Francisco",
"Billing Country": "USA",
"Billing State": "CA",
"Name": "Iguana Park Industries",
"BillingPostalCode": "91156"
},
{
"Billing Street": "777 North St",
"Billing City": "San Francisco",
"Billing Country": "USA",
"Billing State": "CA",
"Name": "Cat Park Industries",
"BillingPostalCode": "91156"
}
]
Enjoy with the Mule!

More Related Content

Viewers also liked

How to write an introduction
How to write an introductionHow to write an introduction
How to write an introduction
syuhada omar
 

Viewers also liked (20)

Mule esb db_2
Mule esb db_2Mule esb db_2
Mule esb db_2
 
Transformation jsontoxmlesb
Transformation jsontoxmlesbTransformation jsontoxmlesb
Transformation jsontoxmlesb
 
My mule esb first http flow
My mule esb first http flowMy mule esb first http flow
My mule esb first http flow
 
Mule esb object_to_json
Mule esb object_to_jsonMule esb object_to_json
Mule esb object_to_json
 
Mule esb db_1
Mule esb db_1Mule esb db_1
Mule esb db_1
 
Transformation xmltoobjectesb
Transformation xmltoobjectesbTransformation xmltoobjectesb
Transformation xmltoobjectesb
 
Transformation csvtoxml
Transformation csvtoxmlTransformation csvtoxml
Transformation csvtoxml
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
 
Mule esb object_to_jackson_json
Mule esb object_to_jackson_jsonMule esb object_to_jackson_json
Mule esb object_to_jackson_json
 
My mule esb flow
My mule esb flowMy mule esb flow
My mule esb flow
 
Transf from csv to xml
Transf from csv to xmlTransf from csv to xml
Transf from csv to xml
 
Esb choice flow
Esb choice flowEsb choice flow
Esb choice flow
 
Mule esb object_to_json
Mule esb object_to_jsonMule esb object_to_json
Mule esb object_to_json
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
 
Rest fullservices
Rest fullservicesRest fullservices
Rest fullservices
 
CSV - 2016
CSV - 2016CSV - 2016
CSV - 2016
 
How To Use Maintenance Tracker
How To Use Maintenance TrackerHow To Use Maintenance Tracker
How To Use Maintenance Tracker
 
How to write an introduction
How to write an introductionHow to write an introduction
How to write an introduction
 
Presentation
PresentationPresentation
Presentation
 
Use Case - Introduction
Use Case - IntroductionUse Case - Introduction
Use Case - Introduction
 

Similar to Mule esb csv_to_json

Uploading customer master extended address using bapi method
Uploading customer master extended address using bapi methodUploading customer master extended address using bapi method
Uploading customer master extended address using bapi method
londonchris1970
 

Similar to Mule esb csv_to_json (20)

Mule esb soap_service
Mule esb soap_serviceMule esb soap_service
Mule esb soap_service
 
Workshop WSO2 BPS 3.5.x - BPMN
Workshop WSO2 BPS 3.5.x - BPMN Workshop WSO2 BPS 3.5.x - BPMN
Workshop WSO2 BPS 3.5.x - BPMN
 
Dataweave Basic
Dataweave BasicDataweave Basic
Dataweave Basic
 
Data weave
Data weave Data weave
Data weave
 
Dataweave
Dataweave Dataweave
Dataweave
 
Data weave
Data weave Data weave
Data weave
 
Data weave
Data weave Data weave
Data weave
 
Data weave
Data weave Data weave
Data weave
 
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
 
Data weave
Data weaveData weave
Data weave
 
How to – data integrity checks in batch processing
How to – data integrity checks in batch processingHow to – data integrity checks in batch processing
How to – data integrity checks in batch processing
 
Data weave in Mule
Data weave in MuleData weave in Mule
Data weave in Mule
 
Data weave
Data weaveData weave
Data weave
 
Data weave
Data weave Data weave
Data weave
 
Data weave
Data weave Data weave
Data weave
 
Data weave
Data weave Data weave
Data weave
 
Data weave
Data weave Data weave
Data weave
 
Data weave
Data weaveData weave
Data weave
 
Simple ETL Solution - Marco Kiesewetter
Simple ETL Solution - Marco KiesewetterSimple ETL Solution - Marco Kiesewetter
Simple ETL Solution - Marco Kiesewetter
 
Uploading customer master extended address using bapi method
Uploading customer master extended address using bapi methodUploading customer master extended address using bapi method
Uploading customer master extended address using bapi method
 

More from Davide Rapacciuolo (10)

Muleesbobjecttojson
Muleesbobjecttojson Muleesbobjecttojson
Muleesbobjecttojson
 
Consuming raml
Consuming ramlConsuming raml
Consuming raml
 
Transformation xmltoobjectesb
Transformation xmltoobjectesbTransformation xmltoobjectesb
Transformation xmltoobjectesb
 
Transformation jsontoxmlesb
Transformation jsontoxmlesbTransformation jsontoxmlesb
Transformation jsontoxmlesb
 
Transformation jsontojsonesb
Transformation jsontojsonesbTransformation jsontojsonesb
Transformation jsontojsonesb
 
Mule esb expression_filter
Mule esb expression_filterMule esb expression_filter
Mule esb expression_filter
 
Mule esb collection_splitter
Mule esb collection_splitterMule esb collection_splitter
Mule esb collection_splitter
 
Json to json transformation in mule
Json to json transformation in muleJson to json transformation in mule
Json to json transformation in mule
 
Mule esb json_to_object
Mule esb json_to_objectMule esb json_to_object
Mule esb json_to_object
 
Mule esb file to-string flow
Mule esb file to-string flowMule esb file to-string flow
Mule esb file to-string flow
 

Recently uploaded

Recently uploaded (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

Mule esb csv_to_json

  • 1. Mule ESB How to convert from CSV to Json
  • 2. In this tutorial we will be creating an easy csv to json converter using mule esb. Let’s begin creating a simple flow with file reader component, in order to trigger the transformation: Now let’s create a csv file under the folder src/main/resources/input named test.csv in this way:
  • 3. Now it’s time to configure the File component to read the csv file just created: Let’s recall that Polling Frequency is the interval of polling the input path (in millliseconds) Now we are ready to put the transformation using the DataWeave component Click on the «Edit sample data» button and paste the content of the csv file in order to see the preview, not before having set the output to application/json and made the payload the output:
  • 4. Finally, put an Object to String transformer and a Logger to see the results: [[db_test].converter_testFlow.stage1.02] org.mule.api.processor.LoggerMessageProcessor: [ { "Billing Street": "111 Boulevard Hausmann", "Billing City": "Paris", "Billing Country": "France", "Billing State": "", "Name": "Dog Park Industries", "BillingPostalCode": "75008" }, { "Billing Street": "400 South St", "Billing City": "San Francisco", "Billing Country": "USA", "Billing State": "CA", "Name": "Iguana Park Industries", "BillingPostalCode": "91156" }, { "Billing Street": "777 North St", "Billing City": "San Francisco", "Billing Country": "USA", "Billing State": "CA", "Name": "Cat Park Industries", "BillingPostalCode": "91156" } ] Enjoy with the Mule!