SlideShare a Scribd company logo
JAVA-MULE
GSN-K
Java Custom Component
• Java components are used write our custom code and custom
transformation. java transformers will be used when we cannot
transform a message using available Mule transformers. In this
example, following components are explained.
• Java Component
• Java component with singleton
• Invoke Component
• Java Transformer
• Reflection Entry Point Resolver
• Annotated Entry Point Resolver
• Invoking a service using java component
Below is the main flow which exposes a HTTP service and
refers to multiple sub flows one after another to cover all above
concepts.
Java Component:
Java component is used to refer a class which has complex code.
Example:
Below is sub flow named 'simple-java-component' which has Set
Payload and java component.
'Set Payload' component sets payload as "Custom Payload".
• Java component is reffered to custom made class
(UsingCallable) which implements Callable interface. This class is used
to print current payload, size of inbound properties and size of
invocation properties.
Above class implements Callable interface. it has
onCall(MuleEventContext eventContext) overriden method. This method
provides MuleEventContext . We can get all the data using MuleContext
instace as shown in above code snippet.Data-Mapper.
Java Component with Singleton:
The singleton object factory does not create a new instance for each
request; instead, the instance is shared.
Example:
Drag java component and double click on the java component to
bring up properties.
Click "+" symbol next to the 'Object' field
Select “core:singleton-object” and click "next".
Click on "..." button and select class
"com.techm.javacustomcomponents.UsingSingletonObject"
• Click on "Advanced" tab and create following three properties using "+"
as shown below and click on Finish.
• name
• dept
• location
Same properties with same names need to be created along with
setters and getters in "UsingSingletonObject" class. So that, specified
properties values in java component are assigned into java class
properties. Below is the code to create map object with these three
properties.
Java mule
Java mule
Java mule
• A bean needs to be created in global elements to use Invoke
component. Create a bean which refers to a custom made java class
in global elements. In "Global Elements" tab click on "Create" button.
• Click on "..." symbol next to "Class" field to select a java custom made
class. Provide some meaningful names in "ID" and "Name" fields. Click
on OK button.
• Drag a invoke component and double click on the component to bring
up the properties. Fill the required fields as shown below.
Java mule
• Name Any meaningful name
• Object Ref "ID" value of bean which is created earlier
• Method Method name which needs to be invoked
• Method Arguments Values of method arguments
• In the same way two more invoke components are created for
two methods (substract and multiply)
•Thank You All
Ad

Recommended

Junit in mule demo
Junit in mule demo
javeed_mhd
 
Maven tools & archetypes
Maven tools & archetypes
Son Nguyen
 
Mule Ajax Connector
Mule Ajax Connector
Ankush Sharma
 
Running mule as worker role on azure
Running mule as worker role on azure
Son Nguyen
 
Troubleshooting mule
Troubleshooting mule
Son Nguyen
 
Stored procedure in Mule
Stored procedure in Mule
Khasim Saheb
 
Invoke component demo in mule
Invoke component demo in mule
Ramakrishna kapa
 
Java in mule part 1
Java in mule part 1
vasanthii9
 
Idempotent filter in mule
Idempotent filter in mule
Mohammed246
 
Integration with Dropbox using Mule ESB
Integration with Dropbox using Mule ESB
Rupesh Sinha
 
Junit in mule demo
Junit in mule demo
Sudha Ch
 
Message properties component in Mule
Message properties component in Mule
Khan625
 
Deploying and Running in Mule
Deploying and Running in Mule
Khasim Saheb
 
Using maven with mule
Using maven with mule
Sindhu VL
 
Mule - logger
Mule - logger
Ankush Sharma
 
Mule velocity
Mule velocity
Praneethchampion
 
Mule testing
Mule testing
Sindhu VL
 
Dynamic file attribute
Dynamic file attribute
Anirban Sen Chowdhary
 
Velocity in Mule
Velocity in Mule
Mohammed246
 
Mule quartz
Mule quartz
Praneethchampion
 
Idempotent filter in Mule
Idempotent filter in Mule
F K
 
Mule java part-1
Mule java part-1
Karnam Karthik
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
Praneethchampion
 
Mule properties
Mule properties
Ravinder Singh
 
Anypoint mq acknowledgement mode
Anypoint mq acknowledgement mode
Son Nguyen
 
Mule - HTTP Listener
Mule - HTTP Listener
Ankush Sharma
 
Propertiesinmule
Propertiesinmule
Christian Hipolito
 
Java
Java
manavp
 
Mule java part-1
Mule java part-1
Karnam Karthik
 
Mule java part-2
Mule java part-2
Karnam Karthik
 

More Related Content

What's hot (19)

Idempotent filter in mule
Idempotent filter in mule
Mohammed246
 
Integration with Dropbox using Mule ESB
Integration with Dropbox using Mule ESB
Rupesh Sinha
 
Junit in mule demo
Junit in mule demo
Sudha Ch
 
Message properties component in Mule
Message properties component in Mule
Khan625
 
Deploying and Running in Mule
Deploying and Running in Mule
Khasim Saheb
 
Using maven with mule
Using maven with mule
Sindhu VL
 
Mule - logger
Mule - logger
Ankush Sharma
 
Mule velocity
Mule velocity
Praneethchampion
 
Mule testing
Mule testing
Sindhu VL
 
Dynamic file attribute
Dynamic file attribute
Anirban Sen Chowdhary
 
Velocity in Mule
Velocity in Mule
Mohammed246
 
Mule quartz
Mule quartz
Praneethchampion
 
Idempotent filter in Mule
Idempotent filter in Mule
F K
 
Mule java part-1
Mule java part-1
Karnam Karthik
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
Praneethchampion
 
Mule properties
Mule properties
Ravinder Singh
 
Anypoint mq acknowledgement mode
Anypoint mq acknowledgement mode
Son Nguyen
 
Mule - HTTP Listener
Mule - HTTP Listener
Ankush Sharma
 
Propertiesinmule
Propertiesinmule
Christian Hipolito
 
Idempotent filter in mule
Idempotent filter in mule
Mohammed246
 
Integration with Dropbox using Mule ESB
Integration with Dropbox using Mule ESB
Rupesh Sinha
 
Junit in mule demo
Junit in mule demo
Sudha Ch
 
Message properties component in Mule
Message properties component in Mule
Khan625
 
Deploying and Running in Mule
Deploying and Running in Mule
Khasim Saheb
 
Using maven with mule
Using maven with mule
Sindhu VL
 
Mule testing
Mule testing
Sindhu VL
 
Velocity in Mule
Velocity in Mule
Mohammed246
 
Idempotent filter in Mule
Idempotent filter in Mule
F K
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
Praneethchampion
 
Anypoint mq acknowledgement mode
Anypoint mq acknowledgement mode
Son Nguyen
 
Mule - HTTP Listener
Mule - HTTP Listener
Ankush Sharma
 

Similar to Java mule (20)

Java
Java
manavp
 
Mule java part-1
Mule java part-1
Karnam Karthik
 
Mule java part-2
Mule java part-2
Karnam Karthik
 
Mule java part-2
Mule java part-2
Ravinder Singh
 
Mule java part-1
Mule java part-1
Ravinder Singh
 
Java in mule part 2
Java in mule part 2
vasanthii9
 
Java component
Java component
krishashi
 
Java component
Java component
Srilatha Kante
 
Java components in Mule
Java components in Mule
Madhuri Chitrala
 
Java components in mule
Java components in mule
Harish43
 
Java Components and their applicability in Mule Anypoint Studio
Java Components and their applicability in Mule Anypoint Studio
VenkataNaveen Kumar
 
Mule: Java Component
Mule: Java Component
Sulthony Hartanto
 
Simple Java component in Mule
Simple Java component in Mule
Christian Hipolito
 
Invoke component
Invoke component
Srilatha Kante
 
Mule ESB
Mule ESB
Yura Nosenko
 
Bindings of components in mule
Bindings of components in mule
Sindhu VL
 
Component bindings in mule
Component bindings in mule
Sindhu VL
 
Bindings of components in mule
Bindings of components in mule
sathishmca143
 
Mule: Java Transformer
Mule: Java Transformer
Sulthony Hartanto
 
Language-Oriented Programming and Language Workbenches: Building Domain Langu...
Language-Oriented Programming and Language Workbenches: Building Domain Langu...
elliando dias
 
Java in mule part 2
Java in mule part 2
vasanthii9
 
Java component
Java component
krishashi
 
Java components in mule
Java components in mule
Harish43
 
Java Components and their applicability in Mule Anypoint Studio
Java Components and their applicability in Mule Anypoint Studio
VenkataNaveen Kumar
 
Bindings of components in mule
Bindings of components in mule
Sindhu VL
 
Component bindings in mule
Component bindings in mule
Sindhu VL
 
Bindings of components in mule
Bindings of components in mule
sathishmca143
 
Language-Oriented Programming and Language Workbenches: Building Domain Langu...
Language-Oriented Programming and Language Workbenches: Building Domain Langu...
elliando dias
 
Ad

More from Gandham38 (8)

Mule routing and filters
Mule routing and filters
Gandham38
 
Mule splitters
Mule splitters
Gandham38
 
Mule system properties
Mule system properties
Gandham38
 
Mule properties
Mule properties
Gandham38
 
Mule batch
Mule batch
Gandham38
 
Mule jms queues
Mule jms queues
Gandham38
 
Mule jms-topics
Mule jms-topics
Gandham38
 
Mule enricher component
Mule enricher component
Gandham38
 
Mule routing and filters
Mule routing and filters
Gandham38
 
Mule splitters
Mule splitters
Gandham38
 
Mule system properties
Mule system properties
Gandham38
 
Mule properties
Mule properties
Gandham38
 
Mule jms queues
Mule jms queues
Gandham38
 
Mule jms-topics
Mule jms-topics
Gandham38
 
Mule enricher component
Mule enricher component
Gandham38
 
Ad

Recently uploaded (20)

THE PSYCHOANALYTIC OF THE BLACK CAT BY EDGAR ALLAN POE (1).pdf
THE PSYCHOANALYTIC OF THE BLACK CAT BY EDGAR ALLAN POE (1).pdf
nabilahk908
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 6-14-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 6-14-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Tanja Vujicic - PISA for Schools contact Info
Tanja Vujicic - PISA for Schools contact Info
EduSkills OECD
 
How payment terms are configured in Odoo 18
How payment terms are configured in Odoo 18
Celine George
 
OBSESSIVE COMPULSIVE DISORDER.pptx IN 5TH SEMESTER B.SC NURSING, 2ND YEAR GNM...
OBSESSIVE COMPULSIVE DISORDER.pptx IN 5TH SEMESTER B.SC NURSING, 2ND YEAR GNM...
parmarjuli1412
 
English 3 Quarter 1_LEwithLAS_Week 1.pdf
English 3 Quarter 1_LEwithLAS_Week 1.pdf
DeAsisAlyanajaneH
 
LAZY SUNDAY QUIZ "A GENERAL QUIZ" JUNE 2025 SMC QUIZ CLUB, SILCHAR MEDICAL CO...
LAZY SUNDAY QUIZ "A GENERAL QUIZ" JUNE 2025 SMC QUIZ CLUB, SILCHAR MEDICAL CO...
Ultimatewinner0342
 
Values Education 10 Quarter 1 Module .pptx
Values Education 10 Quarter 1 Module .pptx
JBPafin
 
Romanticism in Love and Sacrifice An Analysis of Oscar Wilde’s The Nightingal...
Romanticism in Love and Sacrifice An Analysis of Oscar Wilde’s The Nightingal...
KaryanaTantri21
 
Peer Teaching Observations During School Internship
Peer Teaching Observations During School Internship
AjayaMohanty7
 
CRYPTO TRADING COURSE BY FINANCEWORLD.IO
CRYPTO TRADING COURSE BY FINANCEWORLD.IO
AndrewBorisenko3
 
Public Health For The 21st Century 1st Edition Judy Orme Jane Powell
Public Health For The 21st Century 1st Edition Judy Orme Jane Powell
trjnesjnqg7801
 
Gladiolous Cultivation practices by AKL.pdf
Gladiolous Cultivation practices by AKL.pdf
kushallamichhame
 
VCE Literature Section A Exam Response Guide
VCE Literature Section A Exam Response Guide
jpinnuck
 
Vitamin and Nutritional Deficiencies.pptx
Vitamin and Nutritional Deficiencies.pptx
Vishal Chanalia
 
IIT KGP Quiz Week 2024 Sports Quiz (Prelims + Finals)
IIT KGP Quiz Week 2024 Sports Quiz (Prelims + Finals)
IIT Kharagpur Quiz Club
 
This is why students from these 44 institutions have not received National Se...
This is why students from these 44 institutions have not received National Se...
Kweku Zurek
 
How to use search fetch method in Odoo 18
How to use search fetch method in Odoo 18
Celine George
 
2025 June Year 9 Presentation: Subject selection.pptx
2025 June Year 9 Presentation: Subject selection.pptx
mansk2
 
ENGLISH_Q1_W1 PowerPoint grade 3 quarter 1 week 1
ENGLISH_Q1_W1 PowerPoint grade 3 quarter 1 week 1
jutaydeonne
 
THE PSYCHOANALYTIC OF THE BLACK CAT BY EDGAR ALLAN POE (1).pdf
THE PSYCHOANALYTIC OF THE BLACK CAT BY EDGAR ALLAN POE (1).pdf
nabilahk908
 
Tanja Vujicic - PISA for Schools contact Info
Tanja Vujicic - PISA for Schools contact Info
EduSkills OECD
 
How payment terms are configured in Odoo 18
How payment terms are configured in Odoo 18
Celine George
 
OBSESSIVE COMPULSIVE DISORDER.pptx IN 5TH SEMESTER B.SC NURSING, 2ND YEAR GNM...
OBSESSIVE COMPULSIVE DISORDER.pptx IN 5TH SEMESTER B.SC NURSING, 2ND YEAR GNM...
parmarjuli1412
 
English 3 Quarter 1_LEwithLAS_Week 1.pdf
English 3 Quarter 1_LEwithLAS_Week 1.pdf
DeAsisAlyanajaneH
 
LAZY SUNDAY QUIZ "A GENERAL QUIZ" JUNE 2025 SMC QUIZ CLUB, SILCHAR MEDICAL CO...
LAZY SUNDAY QUIZ "A GENERAL QUIZ" JUNE 2025 SMC QUIZ CLUB, SILCHAR MEDICAL CO...
Ultimatewinner0342
 
Values Education 10 Quarter 1 Module .pptx
Values Education 10 Quarter 1 Module .pptx
JBPafin
 
Romanticism in Love and Sacrifice An Analysis of Oscar Wilde’s The Nightingal...
Romanticism in Love and Sacrifice An Analysis of Oscar Wilde’s The Nightingal...
KaryanaTantri21
 
Peer Teaching Observations During School Internship
Peer Teaching Observations During School Internship
AjayaMohanty7
 
CRYPTO TRADING COURSE BY FINANCEWORLD.IO
CRYPTO TRADING COURSE BY FINANCEWORLD.IO
AndrewBorisenko3
 
Public Health For The 21st Century 1st Edition Judy Orme Jane Powell
Public Health For The 21st Century 1st Edition Judy Orme Jane Powell
trjnesjnqg7801
 
Gladiolous Cultivation practices by AKL.pdf
Gladiolous Cultivation practices by AKL.pdf
kushallamichhame
 
VCE Literature Section A Exam Response Guide
VCE Literature Section A Exam Response Guide
jpinnuck
 
Vitamin and Nutritional Deficiencies.pptx
Vitamin and Nutritional Deficiencies.pptx
Vishal Chanalia
 
IIT KGP Quiz Week 2024 Sports Quiz (Prelims + Finals)
IIT KGP Quiz Week 2024 Sports Quiz (Prelims + Finals)
IIT Kharagpur Quiz Club
 
This is why students from these 44 institutions have not received National Se...
This is why students from these 44 institutions have not received National Se...
Kweku Zurek
 
How to use search fetch method in Odoo 18
How to use search fetch method in Odoo 18
Celine George
 
2025 June Year 9 Presentation: Subject selection.pptx
2025 June Year 9 Presentation: Subject selection.pptx
mansk2
 
ENGLISH_Q1_W1 PowerPoint grade 3 quarter 1 week 1
ENGLISH_Q1_W1 PowerPoint grade 3 quarter 1 week 1
jutaydeonne
 

Java mule

  • 2. Java Custom Component • Java components are used write our custom code and custom transformation. java transformers will be used when we cannot transform a message using available Mule transformers. In this example, following components are explained. • Java Component • Java component with singleton • Invoke Component • Java Transformer
  • 3. • Reflection Entry Point Resolver • Annotated Entry Point Resolver • Invoking a service using java component Below is the main flow which exposes a HTTP service and refers to multiple sub flows one after another to cover all above concepts.
  • 4. Java Component: Java component is used to refer a class which has complex code. Example: Below is sub flow named 'simple-java-component' which has Set Payload and java component. 'Set Payload' component sets payload as "Custom Payload".
  • 5. • Java component is reffered to custom made class (UsingCallable) which implements Callable interface. This class is used to print current payload, size of inbound properties and size of invocation properties.
  • 6. Above class implements Callable interface. it has onCall(MuleEventContext eventContext) overriden method. This method provides MuleEventContext . We can get all the data using MuleContext instace as shown in above code snippet.Data-Mapper.
  • 7. Java Component with Singleton: The singleton object factory does not create a new instance for each request; instead, the instance is shared. Example: Drag java component and double click on the java component to bring up properties. Click "+" symbol next to the 'Object' field Select “core:singleton-object” and click "next".
  • 8. Click on "..." button and select class "com.techm.javacustomcomponents.UsingSingletonObject"
  • 9. • Click on "Advanced" tab and create following three properties using "+" as shown below and click on Finish. • name • dept • location Same properties with same names need to be created along with setters and getters in "UsingSingletonObject" class. So that, specified properties values in java component are assigned into java class properties. Below is the code to create map object with these three properties.
  • 13. • A bean needs to be created in global elements to use Invoke component. Create a bean which refers to a custom made java class in global elements. In "Global Elements" tab click on "Create" button. • Click on "..." symbol next to "Class" field to select a java custom made class. Provide some meaningful names in "ID" and "Name" fields. Click on OK button.
  • 14. • Drag a invoke component and double click on the component to bring up the properties. Fill the required fields as shown below.
  • 16. • Name Any meaningful name • Object Ref "ID" value of bean which is created earlier • Method Method name which needs to be invoked • Method Arguments Values of method arguments • In the same way two more invoke components are created for two methods (substract and multiply)