SlideShare a Scribd company logo
1 of 11
How to use DataMapper
Transformer
12-12-2014
Abstract
• The main motto of this PPT is How to use
DataMapper Transformer in our applications.
Introduction
• DataMapper takes data in a specific format
and outputs the same data in the format of
your choice.
Example
.mflow
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:jdbc-ee="http://www.mulesoft.org/schema/mule/ee/jdbc" xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper"
xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule-jdbc-ee.xsd
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd">
<spring:beans>
<spring:bean id="Bean1" name="Bean" class="org.enhydra.jdbc.standard.StandardDataSource">
<spring:property name="driverName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<spring:property name="url" value="jdbc:sqlserver://localhost:1433;databaseName=test1;user=****;password=****;"/>
</spring:bean>
</spring:beans>
<jdbc-ee:connector name="Database" dataSource-ref="Bean1" validateConnections="true" queryTimeout="-1" pollingFrequency="0"
doc:name="Database"/>
<data-mapper:config name="new_mapping_grf" transformationGraphPath="new_mapping.grf" doc:name="new_mapping_grf"/>
<flow name="DataMapper_POCFlow1" doc:name="DataMapper_POCFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8088" path="datamapper" doc:name="HTTP"/>
<logger message="--entered" level="INFO" doc:name="Logger"/>
<jdbc-ee:outbound-endpoint exchange-pattern="request-response" queryKey="select" queryTimeout="-1" connector-ref="Database"
doc:name="Database">
<jdbc-ee:query key="select" value="select * from mytable"/>
</jdbc-ee:outbound-endpoint>
<data-mapper:transform config-ref="new_mapping_grf" doc:name="DataMapper"/>
<logger message="---#[payload]" level="INFO" doc:name="Logger"/>
</flow>
</mule>
• Output:
INFO 2015-12-12 06:28:28,567 [main] org.mule.DefaultMuleContext:
**********************************************************************
* Application: DataMapper_POC *
* OS encoding: Cp1252, Mule encoding: UTF-8 *
* *
* Agents Running: *
* Clustering Agent *
* JMX Agent *
**********************************************************************
INFO 2015-12-12 06:28:28,568 [main] org.mule.module.launcher.MuleDeploymentService:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Started app 'DataMapper_POC' +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
INFO 2015-12-12 06:28:39,973 [[DataMapper_POC].connector.http.mule.default.receiver.02]
org.mule.api.processor.LoggerMessageProcessor: --entered
INFO 2015-12-12 06:28:39,981 [[DataMapper_POC].connector.http.mule.default.receiver.02]
org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'Database.dispatcher.1295829687'. Object is:
EEJdbcMessageDispatcher
INFO 2015-12-12 06:28:39,981 [[DataMapper_POC].connector.http.mule.default.receiver.02]
org.mule.lifecycle.AbstractLifecycleManager: Starting: 'Database.dispatcher.1295829687'. Object is:
EEJdbcMessageDispatcher
INFO 2015-12-12 06:28:41,756 [[DataMapper_POC].connector.http.mule.default.receiver.02]
org.mule.api.processor.LoggerMessageProcessor: ---[{id=1, name=Ramesh, subj=Hindi, marks=55}, {id=2,
name=Mahesh, subj=English, marks=65}, {id=3, name=Pavan, subj=science, marks=75}, {id=4, name=Siva, subj=social,
marks=45}]
• Flow of execution:
1. URL to trigger the service from browser
http://localhost:8088/datamapper
2. Database component connects to the specific
database, executes the select query, maps the
results using DataMapper and prints the result
in console
References
• https://docs.mulesoft.com/mule-user-
guide/v/3.7/datamapper-supplemental-topics

More Related Content

What's hot

How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentmdfkhan625
 
Message properties component in Mule
Message properties component in MuleMessage properties component in Mule
Message properties component in MuleKhan625
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mulejaveed_mhd
 
Java Developers, make the database work for you (NLJUG JFall 2010)
Java Developers, make the database work for you (NLJUG JFall 2010)Java Developers, make the database work for you (NLJUG JFall 2010)
Java Developers, make the database work for you (NLJUG JFall 2010)Lucas Jellema
 
Drupal 7 Feeds Intro Drupal Camp Indianapolis 2011
Drupal 7 Feeds Intro Drupal Camp Indianapolis 2011Drupal 7 Feeds Intro Drupal Camp Indianapolis 2011
Drupal 7 Feeds Intro Drupal Camp Indianapolis 2011jbarclay
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 2...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 2... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 2...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 2...WebStackAcademy
 
Qtp important frameworks
Qtp important frameworksQtp important frameworks
Qtp important frameworksprs0302
 
My sql performance
My sql performanceMy sql performance
My sql performancenchandra33
 

What's hot (11)

How to use wildcard filter
How to use wildcard filterHow to use wildcard filter
How to use wildcard filter
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
Message properties component in Mule
Message properties component in MuleMessage properties component in Mule
Message properties component in Mule
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mule
 
Bean as Datasource
Bean as DatasourceBean as Datasource
Bean as Datasource
 
Database connectivity in ci
Database connectivity in ciDatabase connectivity in ci
Database connectivity in ci
 
Java Developers, make the database work for you (NLJUG JFall 2010)
Java Developers, make the database work for you (NLJUG JFall 2010)Java Developers, make the database work for you (NLJUG JFall 2010)
Java Developers, make the database work for you (NLJUG JFall 2010)
 
Drupal 7 Feeds Intro Drupal Camp Indianapolis 2011
Drupal 7 Feeds Intro Drupal Camp Indianapolis 2011Drupal 7 Feeds Intro Drupal Camp Indianapolis 2011
Drupal 7 Feeds Intro Drupal Camp Indianapolis 2011
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 2...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 2... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 2...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 2...
 
Qtp important frameworks
Qtp important frameworksQtp important frameworks
Qtp important frameworks
 
My sql performance
My sql performanceMy sql performance
My sql performance
 

Viewers also liked

Viewers also liked (13)

Elyse Sydney Kaysha This Is My Penis After All Fall 2015
Elyse Sydney Kaysha This Is My Penis After All Fall 2015Elyse Sydney Kaysha This Is My Penis After All Fall 2015
Elyse Sydney Kaysha This Is My Penis After All Fall 2015
 
Someone-Who is it from-
Someone-Who is it from-Someone-Who is it from-
Someone-Who is it from-
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
 
How to use rest component
How to use rest componentHow to use rest component
How to use rest component
 
Walt disney
Walt disneyWalt disney
Walt disney
 
Introducción a dropbox
Introducción a dropboxIntroducción a dropbox
Introducción a dropbox
 
How to use and filter
How to use and filterHow to use and filter
How to use and filter
 
05- Adel Resume
05- Adel Resume05- Adel Resume
05- Adel Resume
 
How to use splitter component
How to use splitter componentHow to use splitter component
How to use splitter component
 
TeamReport. FINAL
TeamReport. FINALTeamReport. FINAL
TeamReport. FINAL
 
Brady Swift - For the Patriot in all of us - for HIST 214
Brady Swift - For the Patriot in all of us - for HIST 214Brady Swift - For the Patriot in all of us - for HIST 214
Brady Swift - For the Patriot in all of us - for HIST 214
 
Someone Update Flow Chart
Someone Update Flow ChartSomeone Update Flow Chart
Someone Update Flow Chart
 
How to use not filter
How to use not filterHow to use not filter
How to use not filter
 

Similar to How to use data mapper transformer

How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentmaheshtheapex
 
Howtouseforeachcomponent
HowtouseforeachcomponentHowtouseforeachcomponent
Howtouseforeachcomponentakshay yeluru
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentprinceirfancivil
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentirfan1008
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentPhaniu
 
Message properties component in mule demo
Message properties component in mule demoMessage properties component in mule demo
Message properties component in mule demoSudha Ch
 
Specifying a default exception strategy
Specifying a default exception strategySpecifying a default exception strategy
Specifying a default exception strategysivachandra mandalapu
 
Defining global exception strategies
Defining global exception strategiesDefining global exception strategies
Defining global exception strategiessivachandra mandalapu
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentSunil Komarapu
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentKhasim Saheb
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentAnand kalla
 
Message properties component
Message properties component Message properties component
Message properties component Sunil Komarapu
 
Message properties component
Message properties componentMessage properties component
Message properties componentF K
 
Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in MuleKhan625
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in muleKhan625
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filterSunil Komarapu
 

Similar to How to use data mapper transformer (20)

Collection aggregator
Collection aggregatorCollection aggregator
Collection aggregator
 
Mule Message Properties Component
Mule Message Properties ComponentMule Message Properties Component
Mule Message Properties Component
 
Expression Filters
Expression FiltersExpression Filters
Expression Filters
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
Howtouseforeachcomponent
HowtouseforeachcomponentHowtouseforeachcomponent
Howtouseforeachcomponent
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
Property place holder
Property place holderProperty place holder
Property place holder
 
Message properties component in mule demo
Message properties component in mule demoMessage properties component in mule demo
Message properties component in mule demo
 
Specifying a default exception strategy
Specifying a default exception strategySpecifying a default exception strategy
Specifying a default exception strategy
 
Defining global exception strategies
Defining global exception strategiesDefining global exception strategies
Defining global exception strategies
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
Message properties component
Message properties component Message properties component
Message properties component
 
Message properties component
Message properties componentMessage properties component
Message properties component
 
Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in Mule
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mule
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
 

More from RaviRajuRamaKrishna

More from RaviRajuRamaKrishna (7)

Mock component in munit
Mock component in munitMock component in munit
Mock component in munit
 
Jms selector
Jms selectorJms selector
Jms selector
 
Sftplite
SftpliteSftplite
Sftplite
 
Object store
Object storeObject store
Object store
 
How to use soap component
How to use soap componentHow to use soap component
How to use soap component
 
How to use salesforce cloud connector
How to use salesforce cloud connectorHow to use salesforce cloud connector
How to use salesforce cloud connector
 
How to use or filter
How to use or filterHow to use or filter
How to use or filter
 

Recently uploaded

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
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
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
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
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
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
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
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
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
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 

Recently uploaded (20)

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
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
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
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
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
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
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
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
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
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
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
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 

How to use data mapper transformer

  • 1. How to use DataMapper Transformer 12-12-2014
  • 2. Abstract • The main motto of this PPT is How to use DataMapper Transformer in our applications.
  • 3. Introduction • DataMapper takes data in a specific format and outputs the same data in the format of your choice.
  • 5.
  • 6.
  • 7.
  • 8. .mflow <?xml version="1.0" encoding="UTF-8"?> <mule xmlns:jdbc-ee="http://www.mulesoft.org/schema/mule/ee/jdbc" xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd http://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule-jdbc-ee.xsd http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd"> <spring:beans> <spring:bean id="Bean1" name="Bean" class="org.enhydra.jdbc.standard.StandardDataSource"> <spring:property name="driverName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/> <spring:property name="url" value="jdbc:sqlserver://localhost:1433;databaseName=test1;user=****;password=****;"/> </spring:bean> </spring:beans> <jdbc-ee:connector name="Database" dataSource-ref="Bean1" validateConnections="true" queryTimeout="-1" pollingFrequency="0" doc:name="Database"/> <data-mapper:config name="new_mapping_grf" transformationGraphPath="new_mapping.grf" doc:name="new_mapping_grf"/> <flow name="DataMapper_POCFlow1" doc:name="DataMapper_POCFlow1"> <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8088" path="datamapper" doc:name="HTTP"/> <logger message="--entered" level="INFO" doc:name="Logger"/> <jdbc-ee:outbound-endpoint exchange-pattern="request-response" queryKey="select" queryTimeout="-1" connector-ref="Database" doc:name="Database"> <jdbc-ee:query key="select" value="select * from mytable"/> </jdbc-ee:outbound-endpoint> <data-mapper:transform config-ref="new_mapping_grf" doc:name="DataMapper"/> <logger message="---#[payload]" level="INFO" doc:name="Logger"/> </flow> </mule>
  • 9. • Output: INFO 2015-12-12 06:28:28,567 [main] org.mule.DefaultMuleContext: ********************************************************************** * Application: DataMapper_POC * * OS encoding: Cp1252, Mule encoding: UTF-8 * * * * Agents Running: * * Clustering Agent * * JMX Agent * ********************************************************************** INFO 2015-12-12 06:28:28,568 [main] org.mule.module.launcher.MuleDeploymentService: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Started app 'DataMapper_POC' + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ INFO 2015-12-12 06:28:39,973 [[DataMapper_POC].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: --entered INFO 2015-12-12 06:28:39,981 [[DataMapper_POC].connector.http.mule.default.receiver.02] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'Database.dispatcher.1295829687'. Object is: EEJdbcMessageDispatcher INFO 2015-12-12 06:28:39,981 [[DataMapper_POC].connector.http.mule.default.receiver.02] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'Database.dispatcher.1295829687'. Object is: EEJdbcMessageDispatcher INFO 2015-12-12 06:28:41,756 [[DataMapper_POC].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: ---[{id=1, name=Ramesh, subj=Hindi, marks=55}, {id=2, name=Mahesh, subj=English, marks=65}, {id=3, name=Pavan, subj=science, marks=75}, {id=4, name=Siva, subj=social, marks=45}]
  • 10. • Flow of execution: 1. URL to trigger the service from browser http://localhost:8088/datamapper 2. Database component connects to the specific database, executes the select query, maps the results using DataMapper and prints the result in console