SlideShare a Scribd company logo
1 of 7
MuleESB : Fetch Records from
Mysql
In this tutorial we are going to fetch the records
from Mysql Table by using MySql Database
connector with select operation
Pre-requisites :
1.Anypoint Studio 5.2.0
2.Mule Server 3.7.0/3.7.1
3.Mysql Database v6.x
4.Database Table script
MySql Table Script :
CREATE DATABASE IF NOT EXISTS `muleesb`;
USE `muleesb`;
DROP TABLE IF EXISTS `ESB_version`;
CREATE TABLE `ESB_version` (
`server_id` int(11) NOT NULL AUTO_INCREMENT,
`server_version` varchar(45) DEFAULT NULL,
`release_date` datetime DEFAULT NULL,
PRIMARY KEY (`server_id`),
KEY `index1` (`server_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
LOCK TABLES `ESB_version` WRITE;
INSERT INTO `ESB_version` VALUES (1,'3.7.0','2015-07-07 00:00:00'),(2,'3.7.0','2015-
07-07 00:00:00'),(3,'3.7.0','2015-07-07 00:00:00'),(4,'3.7.0','2015-07-07 00:00:00');
UNLOCK TABLES;
Mule Flow :
In the above flow i am fetching the table data from database connector as
ArrayList and this is list is converted to JSON string in the last transformer and
the JSON will be returned to the calling http request .
Mule Source xml :
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0"
port="8081" doc:name="HTTP Listener Configuration"/>
<db:mysql-config name="MySQL_Configuration" host="127.0.0.1" port="3306"
user="anil" password="anil" database="muleesb" doc:name="MySQL
Configuration"/>
<flow name="fetchmysqldataFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/"
doc:name="HTTP"/>
<db:select config-ref="MySQL_Configuration" doc:name="Database">
<db:parameterized-query><![CDATA[select * from
muleesb.ESB_version]]></db:parameterized-query>
</db:select>
<logger message="no of records fetched : #[payload.size()]" level="INFO"
doc:name="Logger"/>
<json:object-to-json-transformer mimeType="application/json"
doc:name="Object to JSON"/></flow>
Flow Request :
http://localhost:8081
Flow Response:
[{"server_version":"3.7.0","release_date":1436207400000,"server_id":1},
{"server_version":"3.7.0","release_date":1436207400000,"server_id":2},
{"server_version":"3.7.0","release_date":1436207400000,"server_id":3},
{"server_version":"3.7.0","release_date":1436207400000,"server_id":4}]
Flow Request :
http://localhost:8081
Flow Response:
[{"server_version":"3.7.0","release_date":1436207400000,"server_id":1},
{"server_version":"3.7.0","release_date":1436207400000,"server_id":2},
{"server_version":"3.7.0","release_date":1436207400000,"server_id":3},
{"server_version":"3.7.0","release_date":1436207400000,"server_id":4}]

More Related Content

What's hot

My sql failover test using orchestrator
My sql failover test  using orchestratorMy sql failover test  using orchestrator
My sql failover test using orchestratorYoungHeon (Roy) Kim
 
AWS ECSを用いてbatchを動かそう
AWS ECSを用いてbatchを動かそうAWS ECSを用いてbatchを動かそう
AWS ECSを用いてbatchを動かそうtaisho2
 
Zookeeper In Action
Zookeeper In ActionZookeeper In Action
Zookeeper In Actionjuvenxu
 
mysql replication
mysql replicationmysql replication
mysql replicationblus4uuu
 
Bkbiet day2 & 3
Bkbiet day2 & 3Bkbiet day2 & 3
Bkbiet day2 & 3mihirio
 
Cloudcamp scotland - Using cloud without losing control
Cloudcamp scotland - Using cloud without losing controlCloudcamp scotland - Using cloud without losing control
Cloudcamp scotland - Using cloud without losing controlDuncan Johnston-Watt
 
PuppetConf 2016: Puppet and UCS: Policy-Based Management All the Way Down – C...
PuppetConf 2016: Puppet and UCS: Policy-Based Management All the Way Down – C...PuppetConf 2016: Puppet and UCS: Policy-Based Management All the Way Down – C...
PuppetConf 2016: Puppet and UCS: Policy-Based Management All the Way Down – C...Puppet
 
Monitor your CentOS stack with Prometheus
Monitor your CentOS stack with PrometheusMonitor your CentOS stack with Prometheus
Monitor your CentOS stack with PrometheusJulien Pivotto
 
Jenkins X on AKS
Jenkins X on AKSJenkins X on AKS
Jenkins X on AKSRyo Fujita
 
Build, Deploy and Manage Your Releases Like a Boss
Build, Deploy and Manage Your Releases Like a BossBuild, Deploy and Manage Your Releases Like a Boss
Build, Deploy and Manage Your Releases Like a BossGlobalLogic Ukraine
 
Creating a Mesos python framework
Creating a Mesos python frameworkCreating a Mesos python framework
Creating a Mesos python frameworkOlivier Sallou
 
zookeeperProgrammers
zookeeperProgrammerszookeeperProgrammers
zookeeperProgrammersHiroshi Ono
 
Fact-Based Monitoring - PuppetConf 2014
Fact-Based Monitoring - PuppetConf 2014Fact-Based Monitoring - PuppetConf 2014
Fact-Based Monitoring - PuppetConf 2014Puppet
 
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'rmcleay
 

What's hot (18)

Cyansible
CyansibleCyansible
Cyansible
 
My sql failover test using orchestrator
My sql failover test  using orchestratorMy sql failover test  using orchestrator
My sql failover test using orchestrator
 
AWS ECSを用いてbatchを動かそう
AWS ECSを用いてbatchを動かそうAWS ECSを用いてbatchを動かそう
AWS ECSを用いてbatchを動かそう
 
Zookeeper In Action
Zookeeper In ActionZookeeper In Action
Zookeeper In Action
 
mysql replication
mysql replicationmysql replication
mysql replication
 
Bkbiet day2 & 3
Bkbiet day2 & 3Bkbiet day2 & 3
Bkbiet day2 & 3
 
Ansible101
Ansible101Ansible101
Ansible101
 
Cloudcamp scotland - Using cloud without losing control
Cloudcamp scotland - Using cloud without losing controlCloudcamp scotland - Using cloud without losing control
Cloudcamp scotland - Using cloud without losing control
 
PuppetConf 2016: Puppet and UCS: Policy-Based Management All the Way Down – C...
PuppetConf 2016: Puppet and UCS: Policy-Based Management All the Way Down – C...PuppetConf 2016: Puppet and UCS: Policy-Based Management All the Way Down – C...
PuppetConf 2016: Puppet and UCS: Policy-Based Management All the Way Down – C...
 
Database Schema as Code
Database Schema as CodeDatabase Schema as Code
Database Schema as Code
 
Monitor your CentOS stack with Prometheus
Monitor your CentOS stack with PrometheusMonitor your CentOS stack with Prometheus
Monitor your CentOS stack with Prometheus
 
Jenkins X on AKS
Jenkins X on AKSJenkins X on AKS
Jenkins X on AKS
 
Awx
AwxAwx
Awx
 
Build, Deploy and Manage Your Releases Like a Boss
Build, Deploy and Manage Your Releases Like a BossBuild, Deploy and Manage Your Releases Like a Boss
Build, Deploy and Manage Your Releases Like a Boss
 
Creating a Mesos python framework
Creating a Mesos python frameworkCreating a Mesos python framework
Creating a Mesos python framework
 
zookeeperProgrammers
zookeeperProgrammerszookeeperProgrammers
zookeeperProgrammers
 
Fact-Based Monitoring - PuppetConf 2014
Fact-Based Monitoring - PuppetConf 2014Fact-Based Monitoring - PuppetConf 2014
Fact-Based Monitoring - PuppetConf 2014
 
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
 

Viewers also liked

Mule concepts flows
Mule concepts flowsMule concepts flows
Mule concepts flowskunal vishe
 
Mule concepts components
Mule concepts componentsMule concepts components
Mule concepts componentskunal vishe
 
Mule ESB - Integration Simplified
Mule ESB - Integration SimplifiedMule ESB - Integration Simplified
Mule ESB - Integration SimplifiedRich Software
 
Mule esb - How to connect to a MySql Database in 5 minutes
Mule esb - How to connect to a MySql Database in 5 minutesMule esb - How to connect to a MySql Database in 5 minutes
Mule esb - How to connect to a MySql Database in 5 minutesGennaro Spagnoli
 
Mule security - jaas
Mule  security - jaasMule  security - jaas
Mule security - jaascharan teja R
 
Mule integration-application
Mule integration-applicationMule integration-application
Mule integration-applicationNaresh Naidu
 
Webservice vm in mule
Webservice vm in muleWebservice vm in mule
Webservice vm in muleShahid Shaik
 
Mule ESB Tutorial Part 3
Mule ESB Tutorial Part 3Mule ESB Tutorial Part 3
Mule ESB Tutorial Part 3Srikanth N
 
Mule esb basic introduction
Mule esb basic introductionMule esb basic introduction
Mule esb basic introductionSon Nguyen
 
Future of Integration | MuleSoft
Future of Integration | MuleSoftFuture of Integration | MuleSoft
Future of Integration | MuleSoftMuleSoft
 
Mule ESB Tutorial Part 1
Mule ESB Tutorial Part 1Mule ESB Tutorial Part 1
Mule ESB Tutorial Part 1Srikanth N
 
Application Architecture: The Next Wave | MuleSoft
Application Architecture: The Next Wave | MuleSoftApplication Architecture: The Next Wave | MuleSoft
Application Architecture: The Next Wave | MuleSoftMuleSoft
 

Viewers also liked (14)

Mule concepts flows
Mule concepts flowsMule concepts flows
Mule concepts flows
 
Mule concepts components
Mule concepts componentsMule concepts components
Mule concepts components
 
Mule message
Mule messageMule message
Mule message
 
Mule ESB Fundamentals
Mule ESB FundamentalsMule ESB Fundamentals
Mule ESB Fundamentals
 
Mule ESB - Integration Simplified
Mule ESB - Integration SimplifiedMule ESB - Integration Simplified
Mule ESB - Integration Simplified
 
Mule esb - How to connect to a MySql Database in 5 minutes
Mule esb - How to connect to a MySql Database in 5 minutesMule esb - How to connect to a MySql Database in 5 minutes
Mule esb - How to connect to a MySql Database in 5 minutes
 
Mule security - jaas
Mule  security - jaasMule  security - jaas
Mule security - jaas
 
Mule integration-application
Mule integration-applicationMule integration-application
Mule integration-application
 
Webservice vm in mule
Webservice vm in muleWebservice vm in mule
Webservice vm in mule
 
Mule ESB Tutorial Part 3
Mule ESB Tutorial Part 3Mule ESB Tutorial Part 3
Mule ESB Tutorial Part 3
 
Mule esb basic introduction
Mule esb basic introductionMule esb basic introduction
Mule esb basic introduction
 
Future of Integration | MuleSoft
Future of Integration | MuleSoftFuture of Integration | MuleSoft
Future of Integration | MuleSoft
 
Mule ESB Tutorial Part 1
Mule ESB Tutorial Part 1Mule ESB Tutorial Part 1
Mule ESB Tutorial Part 1
 
Application Architecture: The Next Wave | MuleSoft
Application Architecture: The Next Wave | MuleSoftApplication Architecture: The Next Wave | MuleSoft
Application Architecture: The Next Wave | MuleSoft
 

Similar to Fetch records from mysql using mule esb

Linuxfest Northwest 2022 - MySQL 8.0 Nre Features
Linuxfest Northwest 2022 - MySQL 8.0 Nre FeaturesLinuxfest Northwest 2022 - MySQL 8.0 Nre Features
Linuxfest Northwest 2022 - MySQL 8.0 Nre FeaturesDave Stokes
 
Interfacing python to mysql (11363255151).pptx
Interfacing python to mysql (11363255151).pptxInterfacing python to mysql (11363255151).pptx
Interfacing python to mysql (11363255151).pptxcavicav231
 
MySQL 8.0 New Features -- September 27th presentation for Open Source Summit
MySQL 8.0 New Features -- September 27th presentation for Open Source SummitMySQL 8.0 New Features -- September 27th presentation for Open Source Summit
MySQL 8.0 New Features -- September 27th presentation for Open Source SummitDave Stokes
 
9780538745840 ppt ch08
9780538745840 ppt ch089780538745840 ppt ch08
9780538745840 ppt ch08Terry Yoast
 
JavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScript
JavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScriptJavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScript
JavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScriptDave Stokes
 
Based on the materials for this week, create your own unique Datab.docx
Based on the materials for this week, create your own unique Datab.docxBased on the materials for this week, create your own unique Datab.docx
Based on the materials for this week, create your own unique Datab.docxJASS44
 
MySQL cluster 72 in the Cloud
MySQL cluster 72 in the CloudMySQL cluster 72 in the Cloud
MySQL cluster 72 in the CloudMarco Tusa
 

Similar to Fetch records from mysql using mule esb (20)

Mule esb db component
Mule esb db componentMule esb db component
Mule esb db component
 
MySQL Basics
MySQL BasicsMySQL Basics
MySQL Basics
 
MySql:Basics
MySql:BasicsMySql:Basics
MySql:Basics
 
MySql:Introduction
MySql:IntroductionMySql:Introduction
MySql:Introduction
 
MySQL Introduction
MySQL IntroductionMySQL Introduction
MySQL Introduction
 
Advance Mobile Application Development class 01
Advance Mobile Application Development class 01Advance Mobile Application Development class 01
Advance Mobile Application Development class 01
 
Linuxfest Northwest 2022 - MySQL 8.0 Nre Features
Linuxfest Northwest 2022 - MySQL 8.0 Nre FeaturesLinuxfest Northwest 2022 - MySQL 8.0 Nre Features
Linuxfest Northwest 2022 - MySQL 8.0 Nre Features
 
Interfacing python to mysql (11363255151).pptx
Interfacing python to mysql (11363255151).pptxInterfacing python to mysql (11363255151).pptx
Interfacing python to mysql (11363255151).pptx
 
Mysql all
Mysql allMysql all
Mysql all
 
MySQL 8.0 New Features -- September 27th presentation for Open Source Summit
MySQL 8.0 New Features -- September 27th presentation for Open Source SummitMySQL 8.0 New Features -- September 27th presentation for Open Source Summit
MySQL 8.0 New Features -- September 27th presentation for Open Source Summit
 
Html web sql database
Html web sql databaseHtml web sql database
Html web sql database
 
PHP with MySQL
PHP with MySQLPHP with MySQL
PHP with MySQL
 
9780538745840 ppt ch08
9780538745840 ppt ch089780538745840 ppt ch08
9780538745840 ppt ch08
 
JavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScript
JavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScriptJavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScript
JavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScript
 
Chef
ChefChef
Chef
 
Chef solo the beginning
Chef solo the beginning Chef solo the beginning
Chef solo the beginning
 
Based on the materials for this week, create your own unique Datab.docx
Based on the materials for this week, create your own unique Datab.docxBased on the materials for this week, create your own unique Datab.docx
Based on the materials for this week, create your own unique Datab.docx
 
MySQL cluster 72 in the Cloud
MySQL cluster 72 in the CloudMySQL cluster 72 in the Cloud
MySQL cluster 72 in the Cloud
 
Node.js with MySQL.pdf
Node.js with MySQL.pdfNode.js with MySQL.pdf
Node.js with MySQL.pdf
 
Python with MySql.pptx
Python with MySql.pptxPython with MySql.pptx
Python with MySql.pptx
 

More from AnilKumar Etagowni

Mule esb data weave multi input data
Mule esb data weave multi input dataMule esb data weave multi input data
Mule esb data weave multi input dataAnilKumar Etagowni
 
Mule ESB SMTP Connector Integration
Mule ESB SMTP Connector  IntegrationMule ESB SMTP Connector  Integration
Mule ESB SMTP Connector IntegrationAnilKumar Etagowni
 
Box connector Mule ESB Integration
Box connector Mule ESB IntegrationBox connector Mule ESB Integration
Box connector Mule ESB IntegrationAnilKumar Etagowni
 
Dropbox connector Mule ESB Integration
Dropbox connector Mule ESB IntegrationDropbox connector Mule ESB Integration
Dropbox connector Mule ESB IntegrationAnilKumar Etagowni
 
Web service invocation in mule
Web service invocation in muleWeb service invocation in mule
Web service invocation in muleAnilKumar Etagowni
 
Running ms sql stored procedures in mule
Running ms sql stored procedures in muleRunning ms sql stored procedures in mule
Running ms sql stored procedures in muleAnilKumar Etagowni
 

More from AnilKumar Etagowni (9)

Spring introduction
Spring introductionSpring introduction
Spring introduction
 
Mule ESB : ssh connector
Mule ESB : ssh connectorMule ESB : ssh connector
Mule ESB : ssh connector
 
Mule esb data weave multi input data
Mule esb data weave multi input dataMule esb data weave multi input data
Mule esb data weave multi input data
 
Mule esb :Data Weave
Mule esb :Data WeaveMule esb :Data Weave
Mule esb :Data Weave
 
Mule ESB SMTP Connector Integration
Mule ESB SMTP Connector  IntegrationMule ESB SMTP Connector  Integration
Mule ESB SMTP Connector Integration
 
Box connector Mule ESB Integration
Box connector Mule ESB IntegrationBox connector Mule ESB Integration
Box connector Mule ESB Integration
 
Dropbox connector Mule ESB Integration
Dropbox connector Mule ESB IntegrationDropbox connector Mule ESB Integration
Dropbox connector Mule ESB Integration
 
Web service invocation in mule
Web service invocation in muleWeb service invocation in mule
Web service invocation in mule
 
Running ms sql stored procedures in mule
Running ms sql stored procedures in muleRunning ms sql stored procedures in mule
Running ms sql stored procedures in mule
 

Recently uploaded

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 

Recently uploaded (20)

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 

Fetch records from mysql using mule esb

  • 1. MuleESB : Fetch Records from Mysql
  • 2. In this tutorial we are going to fetch the records from Mysql Table by using MySql Database connector with select operation Pre-requisites : 1.Anypoint Studio 5.2.0 2.Mule Server 3.7.0/3.7.1 3.Mysql Database v6.x 4.Database Table script
  • 3. MySql Table Script : CREATE DATABASE IF NOT EXISTS `muleesb`; USE `muleesb`; DROP TABLE IF EXISTS `ESB_version`; CREATE TABLE `ESB_version` ( `server_id` int(11) NOT NULL AUTO_INCREMENT, `server_version` varchar(45) DEFAULT NULL, `release_date` datetime DEFAULT NULL, PRIMARY KEY (`server_id`), KEY `index1` (`server_id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1; LOCK TABLES `ESB_version` WRITE; INSERT INTO `ESB_version` VALUES (1,'3.7.0','2015-07-07 00:00:00'),(2,'3.7.0','2015- 07-07 00:00:00'),(3,'3.7.0','2015-07-07 00:00:00'),(4,'3.7.0','2015-07-07 00:00:00'); UNLOCK TABLES;
  • 4. Mule Flow : In the above flow i am fetching the table data from database connector as ArrayList and this is list is converted to JSON string in the last transformer and the JSON will be returned to the calling http request .
  • 5. Mule Source xml : <http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/> <db:mysql-config name="MySQL_Configuration" host="127.0.0.1" port="3306" user="anil" password="anil" database="muleesb" doc:name="MySQL Configuration"/> <flow name="fetchmysqldataFlow"> <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/> <db:select config-ref="MySQL_Configuration" doc:name="Database"> <db:parameterized-query><![CDATA[select * from muleesb.ESB_version]]></db:parameterized-query> </db:select> <logger message="no of records fetched : #[payload.size()]" level="INFO" doc:name="Logger"/> <json:object-to-json-transformer mimeType="application/json" doc:name="Object to JSON"/></flow>
  • 6. Flow Request : http://localhost:8081 Flow Response: [{"server_version":"3.7.0","release_date":1436207400000,"server_id":1}, {"server_version":"3.7.0","release_date":1436207400000,"server_id":2}, {"server_version":"3.7.0","release_date":1436207400000,"server_id":3}, {"server_version":"3.7.0","release_date":1436207400000,"server_id":4}]
  • 7. Flow Request : http://localhost:8081 Flow Response: [{"server_version":"3.7.0","release_date":1436207400000,"server_id":1}, {"server_version":"3.7.0","release_date":1436207400000,"server_id":2}, {"server_version":"3.7.0","release_date":1436207400000,"server_id":3}, {"server_version":"3.7.0","release_date":1436207400000,"server_id":4}]