SlideShare a Scribd company logo
Transformers
sai
• Transformers convert message payloads to formats expected by their destinations
• A Transformer prepares a message to be processed through a Mule flow by enhancing or altering the
message header or message payload
• For example, if the message source that triggers your flow receives data in XML format, but a
downstream message processor requires JSON-formatted data
• one or more transformers positioned between the message source and the message processor can achieve
the necessary translation
Transformers Available in Studio
Script Transformers
Java Object Transformers
Content Transformers
SAP Transformers
Message and Variable Transformers
Creating Custom Transformers
1. Use a Transformer Annotation on a method.
2. The traditional Mule way of creating custom transformers by extending AbstractTransformer
custom transformer is a user-defined transformer class that implements org.mule.api.transformer.Transformer.
Your class can extend AbstractTransformer or AbstractMessageTransform
There are two ways to create a transformer.
The transformer is then configured as follows:
(OR)
@ContainsTransformerMethods // since Mule 3.0.1
public class MyTransformers {  
 @Transformer  
 public URL stringToURL(String string) throws MalformedURLException   {  
     return new java.net.URL(string);
  }
@Transformer
public List<URL> stringsToURLs(String string) throws MalformedURLException {    
 List<URL urls = new ArrayList<URL>();   
  for (StringTokenizer tokenizer = new StringTokenizer(string); tokenizer.hasMoreTokens();)   
  {       
  urls.add(new URL(tokenizer.nextToken()));     }   
  return urls;
}
}
@Transformer Annotation
public class HelloWorldTransformer extends AbstractMessageTransformer{
public Object transformMessage(MuleMessage message, String outputEncoding) throws TransformerException {
@SuppressWarnings("unchecked")
List<employee> employee= (List<employee>) message.getPayload();
message.setOutboundProperty("a", "Hello sai");
for ( employee employee1 : employee) {
System.out.println(employee1.getEid());
System.out.println(employee1.getEmployeename());
System.out.println("******");
if (employee1.getEid()==1) {
System.out.println("i am first variable......");
message.setOutboundProperty("a", employee1.getEid());
}
}
message.setOutboundProperty("b", message.getPayload());
message.setPayload(employee);
return employee;
}
}
-- For example, to make the helloWorldTransformer
discoverable, you would define it as follows:
references
• https://docs.mulesoft.com/mule-user-guide/v/3.8/transformers
• https://docs.mulesoft.com/mule-user-guide/v/3.8/creating-custom-
transformers

More Related Content

What's hot

Mule xml to-jaxb object
Mule xml to-jaxb objectMule xml to-jaxb object
Mule xml to-jaxb object
Ankush Sharma
 
Mule Schema Validation Filter
Mule Schema Validation FilterMule Schema Validation Filter
Mule Schema Validation Filter
Ankush Sharma
 
Mule flow processing strategies
Mule flow processing strategiesMule flow processing strategies
Mule flow processing strategies
D.Rajesh Kumar
 
Mule debugging managing_stack_traces
Mule debugging managing_stack_tracesMule debugging managing_stack_traces
Mule debugging managing_stack_traces
kunal vishe
 
Mule transformers
Mule transformersMule transformers
Mule transformers
Thang Loi
 
Elements in a muleflow
Elements in a muleflowElements in a muleflow
Elements in a muleflow
Thang Loi
 
Mule esb
Mule esbMule esb
Mule esb
charan teja R
 
Mule threading profile & processing strategy
Mule threading profile & processing strategyMule threading profile & processing strategy
Mule threading profile & processing strategy
chetan singhal
 
Mule JMS Transport
Mule JMS TransportMule JMS Transport
Mule JMS Transport
Rupesh Sinha
 
Xml to-object-transformer
Xml to-object-transformerXml to-object-transformer
Xml to-object-transformer
Sanni Kumar Pal
 
Mule scopes foreach_scope
Mule scopes foreach_scopeMule scopes foreach_scope
Mule scopes foreach_scope
kunal vishe
 
Splitter flow control reference
Splitter flow control referenceSplitter flow control reference
Splitter flow control reference
Krishna_in
 
Scatter gather component - mule
Scatter gather component - muleScatter gather component - mule
Scatter gather component - mule
Sindhu VL
 
Splitter and Collection Aggregator With Mulesoft
Splitter and Collection Aggregator With Mulesoft Splitter and Collection Aggregator With Mulesoft
Splitter and Collection Aggregator With Mulesoft
Jitendra Bafna
 
Mule enricher
Mule enricher Mule enricher
Mule enricher
Ravinder Singh
 
Mule routing and filters
Mule routing and filtersMule routing and filters
Mule routing and filters
Gandham38
 
Scatter-Gather
Scatter-GatherScatter-Gather
Scatter-Gather
Francesca Della Corte
 
Mule Message Chunk Aggregator
Mule Message Chunk AggregatorMule Message Chunk Aggregator
Mule Message Chunk Aggregator
Ankush Sharma
 
Mule esb flow processing strategies
Mule esb flow processing strategiesMule esb flow processing strategies
Mule esb flow processing strategies
himajareddys
 
Mule expression component
Mule expression componentMule expression component
Mule expression component
Karnam Karthik
 

What's hot (20)

Mule xml to-jaxb object
Mule xml to-jaxb objectMule xml to-jaxb object
Mule xml to-jaxb object
 
Mule Schema Validation Filter
Mule Schema Validation FilterMule Schema Validation Filter
Mule Schema Validation Filter
 
Mule flow processing strategies
Mule flow processing strategiesMule flow processing strategies
Mule flow processing strategies
 
Mule debugging managing_stack_traces
Mule debugging managing_stack_tracesMule debugging managing_stack_traces
Mule debugging managing_stack_traces
 
Mule transformers
Mule transformersMule transformers
Mule transformers
 
Elements in a muleflow
Elements in a muleflowElements in a muleflow
Elements in a muleflow
 
Mule esb
Mule esbMule esb
Mule esb
 
Mule threading profile & processing strategy
Mule threading profile & processing strategyMule threading profile & processing strategy
Mule threading profile & processing strategy
 
Mule JMS Transport
Mule JMS TransportMule JMS Transport
Mule JMS Transport
 
Xml to-object-transformer
Xml to-object-transformerXml to-object-transformer
Xml to-object-transformer
 
Mule scopes foreach_scope
Mule scopes foreach_scopeMule scopes foreach_scope
Mule scopes foreach_scope
 
Splitter flow control reference
Splitter flow control referenceSplitter flow control reference
Splitter flow control reference
 
Scatter gather component - mule
Scatter gather component - muleScatter gather component - mule
Scatter gather component - mule
 
Splitter and Collection Aggregator With Mulesoft
Splitter and Collection Aggregator With Mulesoft Splitter and Collection Aggregator With Mulesoft
Splitter and Collection Aggregator With Mulesoft
 
Mule enricher
Mule enricher Mule enricher
Mule enricher
 
Mule routing and filters
Mule routing and filtersMule routing and filters
Mule routing and filters
 
Scatter-Gather
Scatter-GatherScatter-Gather
Scatter-Gather
 
Mule Message Chunk Aggregator
Mule Message Chunk AggregatorMule Message Chunk Aggregator
Mule Message Chunk Aggregator
 
Mule esb flow processing strategies
Mule esb flow processing strategiesMule esb flow processing strategies
Mule esb flow processing strategies
 
Mule expression component
Mule expression componentMule expression component
Mule expression component
 

Similar to Ashok mule esb

Mule transformers
Mule transformersMule transformers
Mule transformers
Padmanabhan Natarajan, CSM
 
Mule: Java Transformer
Mule: Java TransformerMule: Java Transformer
Mule: Java Transformer
Sulthony Hartanto
 
Mule esb transformers
Mule esb transformersMule esb transformers
Mule esb transformers
Mani Rathnam Gudi
 
Transformers in Mulesoft Anypoint
Transformers in Mulesoft AnypointTransformers in Mulesoft Anypoint
Transformers in Mulesoft Anypoint
akshay yeluru
 
A short introduction on anypoint transformers
A short introduction on anypoint transformersA short introduction on anypoint transformers
A short introduction on anypoint transformers
Swapnil Sahu
 
Mule esb and_relevant_components
Mule esb and_relevant_componentsMule esb and_relevant_components
Mule esb and_relevant_components
Paaras Baru
 
Mule any point studio
Mule any point studioMule any point studio
Mule any point studio
Son Nguyen
 
Muletransformers
MuletransformersMuletransformers
Muletransformers
vijaynerd
 
Mule transformers
Mule transformersMule transformers
Mule transformers
Thang Loi
 
Mule jms
Mule   jmsMule   jms
Mule message
Mule messageMule message
Mule message
kunal vishe
 
Mule advanced
Mule advancedMule advanced
Mule advanced
D.Rajesh Kumar
 
Custom transformer and annotation
Custom transformer and annotationCustom transformer and annotation
Custom transformer and annotation
Sunil Kumar
 
Mule transformers
Mule transformersMule transformers
Mule transformers
Krishna_in
 
Mule esb
Mule esbMule esb
Mule esb
vishnukanthro45
 
Routing in mule
Routing in muleRouting in mule
Routing in mule
vasanthii9
 
Mule esb overview
Mule esb overviewMule esb overview
Mule esb overview
Gunjan Deshmukh
 
quickguide-einnovator-11-spring-integration
quickguide-einnovator-11-spring-integrationquickguide-einnovator-11-spring-integration
quickguide-einnovator-11-spring-integration
jorgesimao71
 
Controlling Message Flow - Mule ESB
Controlling Message Flow - Mule ESBControlling Message Flow - Mule ESB
Controlling Message Flow - Mule ESB
Mani Rathnam Gudi
 
Mule esb2
Mule esb2Mule esb2
Mule esb2
himajareddys
 

Similar to Ashok mule esb (20)

Mule transformers
Mule transformersMule transformers
Mule transformers
 
Mule: Java Transformer
Mule: Java TransformerMule: Java Transformer
Mule: Java Transformer
 
Mule esb transformers
Mule esb transformersMule esb transformers
Mule esb transformers
 
Transformers in Mulesoft Anypoint
Transformers in Mulesoft AnypointTransformers in Mulesoft Anypoint
Transformers in Mulesoft Anypoint
 
A short introduction on anypoint transformers
A short introduction on anypoint transformersA short introduction on anypoint transformers
A short introduction on anypoint transformers
 
Mule esb and_relevant_components
Mule esb and_relevant_componentsMule esb and_relevant_components
Mule esb and_relevant_components
 
Mule any point studio
Mule any point studioMule any point studio
Mule any point studio
 
Muletransformers
MuletransformersMuletransformers
Muletransformers
 
Mule transformers
Mule transformersMule transformers
Mule transformers
 
Mule jms
Mule   jmsMule   jms
Mule jms
 
Mule message
Mule messageMule message
Mule message
 
Mule advanced
Mule advancedMule advanced
Mule advanced
 
Custom transformer and annotation
Custom transformer and annotationCustom transformer and annotation
Custom transformer and annotation
 
Mule transformers
Mule transformersMule transformers
Mule transformers
 
Mule esb
Mule esbMule esb
Mule esb
 
Routing in mule
Routing in muleRouting in mule
Routing in mule
 
Mule esb overview
Mule esb overviewMule esb overview
Mule esb overview
 
quickguide-einnovator-11-spring-integration
quickguide-einnovator-11-spring-integrationquickguide-einnovator-11-spring-integration
quickguide-einnovator-11-spring-integration
 
Controlling Message Flow - Mule ESB
Controlling Message Flow - Mule ESBControlling Message Flow - Mule ESB
Controlling Message Flow - Mule ESB
 
Mule esb2
Mule esb2Mule esb2
Mule esb2
 

Recently uploaded

GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 

Recently uploaded (20)

GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 

Ashok mule esb

  • 2. • Transformers convert message payloads to formats expected by their destinations • A Transformer prepares a message to be processed through a Mule flow by enhancing or altering the message header or message payload • For example, if the message source that triggers your flow receives data in XML format, but a downstream message processor requires JSON-formatted data • one or more transformers positioned between the message source and the message processor can achieve the necessary translation
  • 3. Transformers Available in Studio Script Transformers Java Object Transformers
  • 5. Creating Custom Transformers 1. Use a Transformer Annotation on a method. 2. The traditional Mule way of creating custom transformers by extending AbstractTransformer custom transformer is a user-defined transformer class that implements org.mule.api.transformer.Transformer. Your class can extend AbstractTransformer or AbstractMessageTransform There are two ways to create a transformer. The transformer is then configured as follows: (OR)
  • 6. @ContainsTransformerMethods // since Mule 3.0.1 public class MyTransformers {    @Transformer    public URL stringToURL(String string) throws MalformedURLException   {        return new java.net.URL(string);   } @Transformer public List<URL> stringsToURLs(String string) throws MalformedURLException {      List<URL urls = new ArrayList<URL>();      for (StringTokenizer tokenizer = new StringTokenizer(string); tokenizer.hasMoreTokens();)      {          urls.add(new URL(tokenizer.nextToken()));     }      return urls; } } @Transformer Annotation
  • 7. public class HelloWorldTransformer extends AbstractMessageTransformer{ public Object transformMessage(MuleMessage message, String outputEncoding) throws TransformerException { @SuppressWarnings("unchecked") List<employee> employee= (List<employee>) message.getPayload(); message.setOutboundProperty("a", "Hello sai"); for ( employee employee1 : employee) { System.out.println(employee1.getEid()); System.out.println(employee1.getEmployeename()); System.out.println("******"); if (employee1.getEid()==1) { System.out.println("i am first variable......"); message.setOutboundProperty("a", employee1.getEid()); } } message.setOutboundProperty("b", message.getPayload()); message.setPayload(employee); return employee; } } -- For example, to make the helloWorldTransformer discoverable, you would define it as follows: