SlideShare a Scribd company logo
Simple Java
Component in Mule
How to use Java in Mule
• Ever wonder how to use your own java class or
utility in mule? Here is a simple sample on how to
use a java component or class in mule.
• This project used mule 3.8 and 6.0
anypointstudio.
Building your Java
Component
• Assuming that you already created a new
project. In this sample, I created a project
named “simplejavacomponent”.
• Also created a package for the java class i will
create.
Simple Java component in Mule
• Based from the previous slide, I created a class
named “SimpleJavaComponent”.
• Also implement an interface named “Callable”
from org.mule.api.lifecycle. You need this inherit
classes by overriding the method “onCall” with a
parameter name “MuleEventContext”.
• The override method simply returns any object or
Object.
Simple Java component in Mule
• In the previous slide, I simply get the current
MuleMessage from the eventContext or
MuleEventContext.
• Then I get the current payload and Cast it in a
String. Then I simply return a String payload just to
showcase how to call a java component. You can
return any objects in onCall.
• You can used this functionality if you want to get
values from current payload and manipulate those
values to a new payload or simply regenerate the
current payload to correct or format some values.
Simple Java component in Mule
Simple Java component in Mule
Simple Java component in Mule
END

More Related Content

PPTX
Initialize database in Mule part2
PPTX
Accessing Mule variables in groovy
PPTX
Groovy with Mule
PPTX
Invoke component demo in mule
PPTX
Simple groovy example in mule
PPTX
Getting anypoint studios all versions
PPTX
Groovy in Mule
PPTX
Cache for community edition
Initialize database in Mule part2
Accessing Mule variables in groovy
Groovy with Mule
Invoke component demo in mule
Simple groovy example in mule
Getting anypoint studios all versions
Groovy in Mule
Cache for community edition

What's hot (12)

PPTX
Groovy example in mule
PPTX
Mule esb add logger to existing flow
PPTX
Deploying and Running in Mule
PPTX
Stored procedure in Mule
PPTX
Maven tools & archetypes
PPTX
Mule message enricher
ODP
Example mule
PPTX
Idempotent filter in Mule
 
PPTX
Running mule standalone
PPTX
Mulesoft Using Groovy Component
PPTX
Mule quartz
PPTX
Junit in mule demo
Groovy example in mule
Mule esb add logger to existing flow
Deploying and Running in Mule
Stored procedure in Mule
Maven tools & archetypes
Mule message enricher
Example mule
Idempotent filter in Mule
 
Running mule standalone
Mulesoft Using Groovy Component
Mule quartz
Junit in mule demo
Ad

Viewers also liked (20)

PDF
Como criar um http proxy dinamico com mule parte 3
PPTX
Radiografia pulmonar
PDF
Ideas fáciles para conseguir que los niños y jóvenes lean más este año
PPT
Moodle
PPTX
хуст
PDF
Alfred Wong's Snapshot CV 2015
ODP
Le roman policier
PPTX
Mule esb handling errors
PPTX
ειρήνη γιαννακοπούλου
PPTX
Connecting External Content to SharePoint Search
PPTX
The Future of Enterprise Search - #SPSUK Keynote
PPTX
Actionbound kullanımı
PDF
Mejora Competencia LingüíStica
PPT
SharePoint Global Deployment with Joel Oleson
PPTX
Five Business Challenges of Hybrid Search #Live360
ODP
οι σηντσου
PPTX
Sli̇deahre proje başlatma.etw_live
PPTX
Push notification salesforce
PDF
προγραμμα ημερίδας και φροντιστηρίων εεπι 28 μαίου ηρακλειο 1
Como criar um http proxy dinamico com mule parte 3
Radiografia pulmonar
Ideas fáciles para conseguir que los niños y jóvenes lean más este año
Moodle
хуст
Alfred Wong's Snapshot CV 2015
Le roman policier
Mule esb handling errors
ειρήνη γιαννακοπούλου
Connecting External Content to SharePoint Search
The Future of Enterprise Search - #SPSUK Keynote
Actionbound kullanımı
Mejora Competencia LingüíStica
SharePoint Global Deployment with Joel Oleson
Five Business Challenges of Hybrid Search #Live360
οι σηντσου
Sli̇deahre proje başlatma.etw_live
Push notification salesforce
προγραμμα ημερίδας και φροντιστηρίων εεπι 28 μαίου ηρακλειο 1
Ad

Similar to Simple Java component in Mule (20)

PPTX
Java component
PPTX
Invoke component
PPT
web program-Inheritance,pack&except in Java.ppt
PPTX
Object Oriented Programming Concepts
PDF
MAVEN - Short documentation
PDF
Integrating Maven with Eclipse
PDF
PPTX
Basics to java programming and concepts of java
PPT
Java components in Mule
PPTX
Java
PPTX
inheritance.pptx
PPTX
Java mule
PPTX
Session 4 - Understanding JAVA Beans.pptx
PDF
Java concurrency model - The Future Task
PPTX
Inheritance in java computer programming app
PDF
Migrating to Java 9 Modules
PDF
Java Multithreading Using Executors Framework
PPTX
Inheritance1
DOCX
Object Oriented Programming in Android Studio
Java component
Invoke component
web program-Inheritance,pack&except in Java.ppt
Object Oriented Programming Concepts
MAVEN - Short documentation
Integrating Maven with Eclipse
Basics to java programming and concepts of java
Java components in Mule
Java
inheritance.pptx
Java mule
Session 4 - Understanding JAVA Beans.pptx
Java concurrency model - The Future Task
Inheritance in java computer programming app
Migrating to Java 9 Modules
Java Multithreading Using Executors Framework
Inheritance1
Object Oriented Programming in Android Studio

More from Christian Hipolito (12)

PPT
Simple Poll in Mule
PPT
Used Java Component To Access Flow and Session Vars
PPT
Flowvar and Sessionvar in Mule
PPT
Simple VM in Mule
PPT
Propertiesinmule
PPT
Jogging101
PPT
PPT
Agile coaching
PPT
Srum master
PPT
Simple Singleton Java
PPT
Simple http and jms for beginners
PPT
Agile Session
Simple Poll in Mule
Used Java Component To Access Flow and Session Vars
Flowvar and Sessionvar in Mule
Simple VM in Mule
Propertiesinmule
Jogging101
Agile coaching
Srum master
Simple Singleton Java
Simple http and jms for beginners
Agile Session

Recently uploaded (20)

PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Approach and Philosophy of On baking technology
PPTX
Big Data Technologies - Introduction.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Getting Started with Data Integration: FME Form 101
PPTX
Tartificialntelligence_presentation.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Encapsulation theory and applications.pdf
PPTX
1. Introduction to Computer Programming.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
MYSQL Presentation for SQL database connectivity
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Machine learning based COVID-19 study performance prediction
Group 1 Presentation -Planning and Decision Making .pptx
SOPHOS-XG Firewall Administrator PPT.pptx
Approach and Philosophy of On baking technology
Big Data Technologies - Introduction.pptx
Electronic commerce courselecture one. Pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Empathic Computing: Creating Shared Understanding
Spectral efficient network and resource selection model in 5G networks
Getting Started with Data Integration: FME Form 101
Tartificialntelligence_presentation.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Building Integrated photovoltaic BIPV_UPV.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Encapsulation theory and applications.pdf
1. Introduction to Computer Programming.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
MYSQL Presentation for SQL database connectivity
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Machine learning based COVID-19 study performance prediction

Simple Java component in Mule

  • 2. How to use Java in Mule • Ever wonder how to use your own java class or utility in mule? Here is a simple sample on how to use a java component or class in mule. • This project used mule 3.8 and 6.0 anypointstudio.
  • 3. Building your Java Component • Assuming that you already created a new project. In this sample, I created a project named “simplejavacomponent”.
  • 4. • Also created a package for the java class i will create.
  • 6. • Based from the previous slide, I created a class named “SimpleJavaComponent”. • Also implement an interface named “Callable” from org.mule.api.lifecycle. You need this inherit classes by overriding the method “onCall” with a parameter name “MuleEventContext”. • The override method simply returns any object or Object.
  • 8. • In the previous slide, I simply get the current MuleMessage from the eventContext or MuleEventContext. • Then I get the current payload and Cast it in a String. Then I simply return a String payload just to showcase how to call a java component. You can return any objects in onCall. • You can used this functionality if you want to get values from current payload and manipulate those values to a new payload or simply regenerate the current payload to correct or format some values.
  • 12. END