SlideShare uma empresa Scribd logo
1 de 12
By Anirban Sen Chowdhary
We often get a requirement of scheduling a task or monitoring some event
consistently when our application is running on server.
In that case we need to create a thread in our application that will constantly
monitor the event in our application and start the task after every fixed interval of
time.
In Mule we get plenty of options of doing it like using Quartz scheduler or Poll
component etc.
But what if we want to use our custom java class for that ???
Yes, we can do a scheduling and monitoring activity using a Java class and Spring
task scheduler in our Mule application….
Let’s consider we have a simple Mule flow as following:-
Now, this is a simple flow where we will hit a url in the browser and it will send a
response to the browser and log the payload in console.
Now, we will also create a Java class here that will constantly load itself after the
application run in the server after every 10 sec and will print a message in console.
Let’s consider we our Java class is as following:-
This is a simple Java class that will log a message after every 10 seconds and will
be running in our application and will be monitoring in our application.
We can customize this class as per our requirement and put our own code here for
monitoring.
So far, I have kept it simple only to demonstrate the functionality
So here is our Spring configuration in the Mule config that will trigger this class
after every 10 second and keep the thread alive for monitoring and printing in the
console:-
Here you can see the Spring task scheduler is scheduling the Java class after every
10 sec. Also there is a Mule flow that will print the message in the browser and
console if we hit the url http://localhost:8082/test in browser
So if we run our application we will see the message after every 10 sec.:-
So if we hit url http://localhost:8082/test in browser we will get the following .:-
Also in the console we will get .:-
But the interesting fact is the Spring task scheduler is executing the Java class after
every 10 sec. So, using Java and Spring you can schedule and monitor events in
Mule which is an alternative to Quartz and Poll components
In my next slide I will bring some other techniques in Mule implementation .
Hope you have enjoyed this simpler version.
Keep sharing your knowledge and let our Mule community grow 
Scheduling and monitoring with java in mule

Mais conteúdo relacionado

Mais procurados (9)

Timer Interceptor in Mule
Timer Interceptor in MuleTimer Interceptor in Mule
Timer Interceptor in Mule
 
Running mule from java
Running mule from javaRunning mule from java
Running mule from java
 
Accessing jms in mule using groovy
Accessing jms in mule using groovyAccessing jms in mule using groovy
Accessing jms in mule using groovy
 
Mule soap
Mule soapMule soap
Mule soap
 
Validate soap request in mule
Validate soap request in muleValidate soap request in mule
Validate soap request in mule
 
Deploy apps in standalone with maven
Deploy apps in standalone with mavenDeploy apps in standalone with maven
Deploy apps in standalone with maven
 
Using spring task scheduler in java in mule
Using spring task scheduler in java in muleUsing spring task scheduler in java in mule
Using spring task scheduler in java in mule
 
Soap in mule
Soap in muleSoap in mule
Soap in mule
 
Soap request in mule
Soap request in mule Soap request in mule
Soap request in mule
 

Destaque

Destaque (20)

Filtering jms messages with mule
Filtering jms messages with muleFiltering jms messages with mule
Filtering jms messages with mule
 
Initialize database in Mule part2
Initialize database in Mule part2Initialize database in Mule part2
Initialize database in Mule part2
 
Accessing jms in mule using groovy
Accessing jms in mule using groovyAccessing jms in mule using groovy
Accessing jms in mule using groovy
 
Mule idempotent filter and Object Store
Mule idempotent filter and Object StoreMule idempotent filter and Object Store
Mule idempotent filter and Object Store
 
Mule with drools
Mule with droolsMule with drools
Mule with drools
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
 
Cache for community edition
Cache for community editionCache for community edition
Cache for community edition
 
Automatic documentation with mule
Automatic documentation with mule Automatic documentation with mule
Automatic documentation with mule
 
Mule accessing multiple database in parallel
Mule accessing multiple database in parallelMule accessing multiple database in parallel
Mule accessing multiple database in parallel
 
Accessing jms in mule using groovy
Accessing jms in mule using groovyAccessing jms in mule using groovy
Accessing jms in mule using groovy
 
Mule with composite source
Mule with composite sourceMule with composite source
Mule with composite source
 
Combing xml in Mule
Combing xml in MuleCombing xml in Mule
Combing xml in Mule
 
Delaying jms with mule
Delaying jms with muleDelaying jms with mule
Delaying jms with mule
 
Sharing resources with mule
Sharing resources with muleSharing resources with mule
Sharing resources with mule
 
Mule Groovy component
Mule Groovy componentMule Groovy component
Mule Groovy component
 
Mule dynamic name space
Mule dynamic name spaceMule dynamic name space
Mule dynamic name space
 
Spring security integrate with mule
Spring security integrate with muleSpring security integrate with mule
Spring security integrate with mule
 
Splitting with mule part2
Splitting with mule part2Splitting with mule part2
Splitting with mule part2
 
Using properties in mule
Using properties in muleUsing properties in mule
Using properties in mule
 
Calling flow from another application
Calling flow from another applicationCalling flow from another application
Calling flow from another application
 

Semelhante a Scheduling and monitoring with java in mule

Semelhante a Scheduling and monitoring with java in mule (20)

Schedule and monitor in mule
Schedule and monitor in muleSchedule and monitor in mule
Schedule and monitor in mule
 
Using spring scheduler mule
Using spring scheduler muleUsing spring scheduler mule
Using spring scheduler mule
 
Cache for community edition
Cache for community editionCache for community edition
Cache for community edition
 
Cache for community edition
Cache for community edition Cache for community edition
Cache for community edition
 
Community edition Cache
Community edition CacheCommunity edition Cache
Community edition Cache
 
Cache for community edition
Cache for community editionCache for community edition
Cache for community edition
 
Cache community edition
Cache community edition Cache community edition
Cache community edition
 
Cache for community edition
Cache for community edition Cache for community edition
Cache for community edition
 
Cache for community edition
Cache for community edition Cache for community edition
Cache for community edition
 
Cache for community edition
Cache for community editionCache for community edition
Cache for community edition
 
Cache for community edition
Cache for community editionCache for community edition
Cache for community edition
 
Cache for community edition
Cache for community editionCache for community edition
Cache for community edition
 
Deploying and running in mule standalone
Deploying and running in mule standaloneDeploying and running in mule standalone
Deploying and running in mule standalone
 
Deploying and running in mule standalone
Deploying and running in mule standaloneDeploying and running in mule standalone
Deploying and running in mule standalone
 
Deploying and running in mule standalone
Deploying and running in mule standaloneDeploying and running in mule standalone
Deploying and running in mule standalone
 
Deploying and Running in Mule
Deploying and Running in MuleDeploying and Running in Mule
Deploying and Running in Mule
 
Deploying and running in mule standalone
Deploying and running in mule standaloneDeploying and running in mule standalone
Deploying and running in mule standalone
 
Deploying and running mule standalone
Deploying and running mule standaloneDeploying and running mule standalone
Deploying and running mule standalone
 
Deploy with maven
Deploy with mavenDeploy with maven
Deploy with maven
 
Running mule standalone
Running mule standaloneRunning mule standalone
Running mule standalone
 

Mais de Anirban Sen Chowdhary

Mais de Anirban Sen Chowdhary (20)

Change the game with Game changer
Change the game with Game changerChange the game with Game changer
Change the game with Game changer
 
Ring central desktop app overview
Ring central desktop app overviewRing central desktop app overview
Ring central desktop app overview
 
Overview in ringcentral digital line
Overview in ringcentral digital lineOverview in ringcentral digital line
Overview in ringcentral digital line
 
Some basics with ring central
Some basics with ring centralSome basics with ring central
Some basics with ring central
 
Ring central and python
Ring central and pythonRing central and python
Ring central and python
 
RingCentral application development overview
RingCentral application development overviewRingCentral application development overview
RingCentral application development overview
 
Cloze connect ringcentral
Cloze connect ringcentralCloze connect ringcentral
Cloze connect ringcentral
 
Overview on ring central errors part 4
Overview on ring central errors part 4Overview on ring central errors part 4
Overview on ring central errors part 4
 
Setting up your ring central sandbox in steps
Setting up your ring central sandbox in stepsSetting up your ring central sandbox in steps
Setting up your ring central sandbox in steps
 
Overview on ring central errors: part 2
Overview on ring central errors: part 2Overview on ring central errors: part 2
Overview on ring central errors: part 2
 
Overview on ring central errors
Overview on ring central errorsOverview on ring central errors
Overview on ring central errors
 
Call recording overview ring central
Call recording overview  ring centralCall recording overview  ring central
Call recording overview ring central
 
Ring central engaging with amazon alexa
Ring central engaging with amazon alexaRing central engaging with amazon alexa
Ring central engaging with amazon alexa
 
How ring central sdk changing the game
How ring central sdk changing the gameHow ring central sdk changing the game
How ring central sdk changing the game
 
When ring central connect salesforce
When ring central connect salesforceWhen ring central connect salesforce
When ring central connect salesforce
 
Mule 4 connecting ring central
Mule 4 connecting ring centralMule 4 connecting ring central
Mule 4 connecting ring central
 
Ring central sdk
Ring central sdkRing central sdk
Ring central sdk
 
Ring central with okta
Ring central with oktaRing central with okta
Ring central with okta
 
Ring central connecting salesforce overview
Ring central connecting salesforce overviewRing central connecting salesforce overview
Ring central connecting salesforce overview
 
Ring central call logs overview (part 2)
Ring central call logs overview (part 2)Ring central call logs overview (part 2)
Ring central call logs overview (part 2)
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 

Scheduling and monitoring with java in mule

  • 1. By Anirban Sen Chowdhary
  • 2. We often get a requirement of scheduling a task or monitoring some event consistently when our application is running on server. In that case we need to create a thread in our application that will constantly monitor the event in our application and start the task after every fixed interval of time. In Mule we get plenty of options of doing it like using Quartz scheduler or Poll component etc. But what if we want to use our custom java class for that ???
  • 3. Yes, we can do a scheduling and monitoring activity using a Java class and Spring task scheduler in our Mule application….
  • 4.
  • 5. Let’s consider we have a simple Mule flow as following:- Now, this is a simple flow where we will hit a url in the browser and it will send a response to the browser and log the payload in console. Now, we will also create a Java class here that will constantly load itself after the application run in the server after every 10 sec and will print a message in console.
  • 6. Let’s consider we our Java class is as following:- This is a simple Java class that will log a message after every 10 seconds and will be running in our application and will be monitoring in our application. We can customize this class as per our requirement and put our own code here for monitoring. So far, I have kept it simple only to demonstrate the functionality
  • 7. So here is our Spring configuration in the Mule config that will trigger this class after every 10 second and keep the thread alive for monitoring and printing in the console:- Here you can see the Spring task scheduler is scheduling the Java class after every 10 sec. Also there is a Mule flow that will print the message in the browser and console if we hit the url http://localhost:8082/test in browser
  • 8. So if we run our application we will see the message after every 10 sec.:-
  • 9. So if we hit url http://localhost:8082/test in browser we will get the following .:-
  • 10. Also in the console we will get .:- But the interesting fact is the Spring task scheduler is executing the Java class after every 10 sec. So, using Java and Spring you can schedule and monitor events in Mule which is an alternative to Quartz and Poll components
  • 11. In my next slide I will bring some other techniques in Mule implementation . Hope you have enjoyed this simpler version. Keep sharing your knowledge and let our Mule community grow 