SlideShare a Scribd company logo
1 of 16
Agenda
• Scheduler
• Cron Expression
• Polling
• Sling Jobs
• Demo
What is Scheduler ???
●
Apache Sling Scheduler enables you to easily
schedule jobs within your application
●
Jobs can be executed at a specific time, regularly
at a given period or at the time given by a cron
expression by leveraging the Sling scheduler
service
The scheduler can be used in two ways:
● by registering the job through the scheduler API
● by leveraging the whiteboard pattern that is
supported by the scheduler
How to Write a Scheduler?
Cron Expressions
What is Polling ???
●
Polling is a data importer service for Adobe Experience Manager
(AEM) that lets you import data
●
To address some business requirements, importing external data
into your AEM site is an important use case
Polling Importer
● The Sling Event Support adds the notion of a job
● A job is a special event that has to be processed
exactly once
● A job consumer should be prepared to process a
job more than once
Sling Jobs (Guarantee of Processing)
Sling Jobs (Guarantee of Processing)
A job consists of two parts, the job topic describing the nature of the job
and the payload which is a key value map of serializable objects.
In Sling jobs,we create
1.Job Producer
2. Job Consumer
Job producer gets created with job name in /var/eventing/unassigned
Job consumer gets created with job name in /var/eventing/assigned
Job Producer (Syntax)
@Component
public class Jobs {
@Reference
private JobManager jobManager;
public void startJob() {
final Map<String, Object> props = new HashMap<String, Object>();
props.put("item1", "/something");
props.put("count", 5);
jobManager.addJob("sling/orderedtest/start", props);
}
}
Job Consumer (Syntax)
@Component
@Service(value={JobConsumer.class})
@Property(name=JobConsumer.PROPERTY_TOPICS,
value="my/special/jobtopic",)
public class MyJobConsumer implements JobConsumer {
public JobResult process(final Job job) {
// process the job and return the result
return JobResult.OK;
}
}
You can create your own queue in felix console by
Apache Sling job Queue Configuration
References
References for SchedulersReferences for Schedulers
● Scheduler-jobs examples
● Schedulers in AEM
● aem-adobecq5-code-templates- scheduler
References for Cron ExpressionsReferences for Cron Expressions
● Cron Trigger Explanation
● Cron Making Examples
● Cron Maker Online Tool
Scheduler_session
Scheduler_session

More Related Content

What's hot

Functional Reactive Endpoints using Spring 5
Functional Reactive Endpoints using Spring 5Functional Reactive Endpoints using Spring 5
Functional Reactive Endpoints using Spring 5Rory Preddy
 
inline function
inline function inline function
inline function imran khan
 
From monolithic to serverless with Amazon Step Functions
From monolithic to serverless with Amazon Step FunctionsFrom monolithic to serverless with Amazon Step Functions
From monolithic to serverless with Amazon Step FunctionsScott Triglia
 
Angular & RXJS: examples and use cases
Angular & RXJS: examples and use casesAngular & RXJS: examples and use cases
Angular & RXJS: examples and use casesFabio Biondi
 
Rescale New Feature: Bring Your Own VPC
Rescale New Feature: Bring Your Own VPCRescale New Feature: Bring Your Own VPC
Rescale New Feature: Bring Your Own VPCTakahisa Shiratori
 
The Apollo and GraphQL Stack
The Apollo and GraphQL StackThe Apollo and GraphQL Stack
The Apollo and GraphQL StackSashko Stubailo
 
Raphael Amorim - Scrating React Fiber
Raphael Amorim - Scrating React FiberRaphael Amorim - Scrating React Fiber
Raphael Amorim - Scrating React FiberReact Conf Brasil
 
Airflow techtonic template
Airflow   techtonic templateAirflow   techtonic template
Airflow techtonic templateSampath Kumar
 
Calling AWS Lambda through Amazon Alexa
Calling AWS Lambda through Amazon AlexaCalling AWS Lambda through Amazon Alexa
Calling AWS Lambda through Amazon AlexaMatt Billock
 
Reflective injection using TypeScript
Reflective injection using TypeScriptReflective injection using TypeScript
Reflective injection using TypeScriptIlia Idakiev
 
Patterns and practices for real-world event-driven microservices
Patterns and practices for real-world event-driven microservicesPatterns and practices for real-world event-driven microservices
Patterns and practices for real-world event-driven microservicesRachel Reese
 
Creating a Symfony Ecommerce App
Creating a Symfony Ecommerce AppCreating a Symfony Ecommerce App
Creating a Symfony Ecommerce AppMuhammad Azaz Qadir
 
A different thought angular js part-3
A different thought   angular js part-3A different thought   angular js part-3
A different thought angular js part-3Amit Thakkar
 
Why UI Developers Love GraphQL - Sashko Stubailo, Apollo/Meteor
Why UI Developers Love GraphQL - Sashko Stubailo, Apollo/MeteorWhy UI Developers Love GraphQL - Sashko Stubailo, Apollo/Meteor
Why UI Developers Love GraphQL - Sashko Stubailo, Apollo/MeteorJon Wong
 
Matheus Marsiglio - Isomorphic React + Redux App
Matheus Marsiglio - Isomorphic React + Redux AppMatheus Marsiglio - Isomorphic React + Redux App
Matheus Marsiglio - Isomorphic React + Redux AppReact Conf Brasil
 
Postgres Conf Keynote: What got you here WILL get you there
Postgres Conf Keynote: What got you here WILL get you therePostgres Conf Keynote: What got you here WILL get you there
Postgres Conf Keynote: What got you here WILL get you thereAnant Jhingran
 
redux and angular - up and running
redux and angular - up and runningredux and angular - up and running
redux and angular - up and runningNir Kaufman
 

What's hot (20)

Functional Reactive Endpoints using Spring 5
Functional Reactive Endpoints using Spring 5Functional Reactive Endpoints using Spring 5
Functional Reactive Endpoints using Spring 5
 
inline function
inline function inline function
inline function
 
From monolithic to serverless with Amazon Step Functions
From monolithic to serverless with Amazon Step FunctionsFrom monolithic to serverless with Amazon Step Functions
From monolithic to serverless with Amazon Step Functions
 
Angular & RXJS: examples and use cases
Angular & RXJS: examples and use casesAngular & RXJS: examples and use cases
Angular & RXJS: examples and use cases
 
Rescale New Feature: Bring Your Own VPC
Rescale New Feature: Bring Your Own VPCRescale New Feature: Bring Your Own VPC
Rescale New Feature: Bring Your Own VPC
 
Serverless GraphQL with AWS AppSync & AWS Amplify
Serverless GraphQL with AWS AppSync & AWS AmplifyServerless GraphQL with AWS AppSync & AWS Amplify
Serverless GraphQL with AWS AppSync & AWS Amplify
 
The Apollo and GraphQL Stack
The Apollo and GraphQL StackThe Apollo and GraphQL Stack
The Apollo and GraphQL Stack
 
Raphael Amorim - Scrating React Fiber
Raphael Amorim - Scrating React FiberRaphael Amorim - Scrating React Fiber
Raphael Amorim - Scrating React Fiber
 
Airflow techtonic template
Airflow   techtonic templateAirflow   techtonic template
Airflow techtonic template
 
Calling AWS Lambda through Amazon Alexa
Calling AWS Lambda through Amazon AlexaCalling AWS Lambda through Amazon Alexa
Calling AWS Lambda through Amazon Alexa
 
Reflective injection using TypeScript
Reflective injection using TypeScriptReflective injection using TypeScript
Reflective injection using TypeScript
 
Python reliable delivery
Python reliable deliveryPython reliable delivery
Python reliable delivery
 
Patterns and practices for real-world event-driven microservices
Patterns and practices for real-world event-driven microservicesPatterns and practices for real-world event-driven microservices
Patterns and practices for real-world event-driven microservices
 
Creating a Symfony Ecommerce App
Creating a Symfony Ecommerce AppCreating a Symfony Ecommerce App
Creating a Symfony Ecommerce App
 
A different thought angular js part-3
A different thought   angular js part-3A different thought   angular js part-3
A different thought angular js part-3
 
Why UI Developers Love GraphQL - Sashko Stubailo, Apollo/Meteor
Why UI Developers Love GraphQL - Sashko Stubailo, Apollo/MeteorWhy UI Developers Love GraphQL - Sashko Stubailo, Apollo/Meteor
Why UI Developers Love GraphQL - Sashko Stubailo, Apollo/Meteor
 
Matheus Marsiglio - Isomorphic React + Redux App
Matheus Marsiglio - Isomorphic React + Redux AppMatheus Marsiglio - Isomorphic React + Redux App
Matheus Marsiglio - Isomorphic React + Redux App
 
Postgres Conf Keynote: What got you here WILL get you there
Postgres Conf Keynote: What got you here WILL get you therePostgres Conf Keynote: What got you here WILL get you there
Postgres Conf Keynote: What got you here WILL get you there
 
redux and angular - up and running
redux and angular - up and runningredux and angular - up and running
redux and angular - up and running
 
Fabppt
FabpptFabppt
Fabppt
 

Similar to Scheduler_session

Introduction to App Engine Development
Introduction to App Engine DevelopmentIntroduction to App Engine Development
Introduction to App Engine DevelopmentRon Reiter
 
What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)
What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)
What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)DicodingEvent
 
AngularJS - Services
AngularJS - ServicesAngularJS - Services
AngularJS - ServicesNir Kaufman
 
Front end development with Angular JS
Front end development with Angular JSFront end development with Angular JS
Front end development with Angular JSBipin
 
Google app-engine-with-python
Google app-engine-with-pythonGoogle app-engine-with-python
Google app-engine-with-pythonDeepak Garg
 
Anatomy of classic map reduce in hadoop
Anatomy of classic map reduce in hadoop Anatomy of classic map reduce in hadoop
Anatomy of classic map reduce in hadoop Rajesh Ananda Kumar
 
predefined and user defined functions
predefined and user defined functionspredefined and user defined functions
predefined and user defined functionsSwapnil Yadav
 
...and thus your forms automagically disappeared
...and thus your forms automagically disappeared...and thus your forms automagically disappeared
...and thus your forms automagically disappearedLuc Bors
 
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
I Know It Was MEAN, But I Cut the Cord to LAMP AnywayI Know It Was MEAN, But I Cut the Cord to LAMP Anyway
I Know It Was MEAN, But I Cut the Cord to LAMP AnywayAll Things Open
 
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
I Know It Was MEAN, But I Cut the Cord to LAMP AnywayI Know It Was MEAN, But I Cut the Cord to LAMP Anyway
I Know It Was MEAN, But I Cut the Cord to LAMP AnywayPOSSCON
 
Using JHipster 4 for generating Angular/Spring Boot apps
Using JHipster 4 for generating Angular/Spring Boot appsUsing JHipster 4 for generating Angular/Spring Boot apps
Using JHipster 4 for generating Angular/Spring Boot appsYakov Fain
 
Building a Sustainable Data Platform on AWS
Building a Sustainable Data Platform on AWSBuilding a Sustainable Data Platform on AWS
Building a Sustainable Data Platform on AWSSmartNews, Inc.
 
Using JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot appsUsing JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot appsYakov Fain
 
Using Jhipster 4 for Generating Angular/Spring Boot Apps
Using Jhipster 4 for Generating Angular/Spring Boot AppsUsing Jhipster 4 for Generating Angular/Spring Boot Apps
Using Jhipster 4 for Generating Angular/Spring Boot AppsVMware Tanzu
 

Similar to Scheduler_session (20)

Introduction to App Engine Development
Introduction to App Engine DevelopmentIntroduction to App Engine Development
Introduction to App Engine Development
 
What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)
What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)
What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)
 
AngularJS - Services
AngularJS - ServicesAngularJS - Services
AngularJS - Services
 
JavaScript for real men
JavaScript for real menJavaScript for real men
JavaScript for real men
 
Spring batch
Spring batchSpring batch
Spring batch
 
Les 17 sched
Les 17 schedLes 17 sched
Les 17 sched
 
Front end development with Angular JS
Front end development with Angular JSFront end development with Angular JS
Front end development with Angular JS
 
Google app-engine-with-python
Google app-engine-with-pythonGoogle app-engine-with-python
Google app-engine-with-python
 
Anatomy of classic map reduce in hadoop
Anatomy of classic map reduce in hadoop Anatomy of classic map reduce in hadoop
Anatomy of classic map reduce in hadoop
 
Introduction to Google App Engine
Introduction to Google App EngineIntroduction to Google App Engine
Introduction to Google App Engine
 
Advance JS and oop
Advance JS and oopAdvance JS and oop
Advance JS and oop
 
predefined and user defined functions
predefined and user defined functionspredefined and user defined functions
predefined and user defined functions
 
...and thus your forms automagically disappeared
...and thus your forms automagically disappeared...and thus your forms automagically disappeared
...and thus your forms automagically disappeared
 
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
I Know It Was MEAN, But I Cut the Cord to LAMP AnywayI Know It Was MEAN, But I Cut the Cord to LAMP Anyway
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
 
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
I Know It Was MEAN, But I Cut the Cord to LAMP AnywayI Know It Was MEAN, But I Cut the Cord to LAMP Anyway
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
 
Using JHipster 4 for generating Angular/Spring Boot apps
Using JHipster 4 for generating Angular/Spring Boot appsUsing JHipster 4 for generating Angular/Spring Boot apps
Using JHipster 4 for generating Angular/Spring Boot apps
 
Hadoop job chaining
Hadoop job chainingHadoop job chaining
Hadoop job chaining
 
Building a Sustainable Data Platform on AWS
Building a Sustainable Data Platform on AWSBuilding a Sustainable Data Platform on AWS
Building a Sustainable Data Platform on AWS
 
Using JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot appsUsing JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot apps
 
Using Jhipster 4 for Generating Angular/Spring Boot Apps
Using Jhipster 4 for Generating Angular/Spring Boot AppsUsing Jhipster 4 for Generating Angular/Spring Boot Apps
Using Jhipster 4 for Generating Angular/Spring Boot Apps
 

Scheduler_session

  • 1.
  • 2. Agenda • Scheduler • Cron Expression • Polling • Sling Jobs • Demo
  • 3. What is Scheduler ??? ● Apache Sling Scheduler enables you to easily schedule jobs within your application ● Jobs can be executed at a specific time, regularly at a given period or at the time given by a cron expression by leveraging the Sling scheduler service
  • 4. The scheduler can be used in two ways: ● by registering the job through the scheduler API ● by leveraging the whiteboard pattern that is supported by the scheduler How to Write a Scheduler?
  • 6. What is Polling ??? ● Polling is a data importer service for Adobe Experience Manager (AEM) that lets you import data ● To address some business requirements, importing external data into your AEM site is an important use case
  • 8.
  • 9. ● The Sling Event Support adds the notion of a job ● A job is a special event that has to be processed exactly once ● A job consumer should be prepared to process a job more than once Sling Jobs (Guarantee of Processing)
  • 10. Sling Jobs (Guarantee of Processing) A job consists of two parts, the job topic describing the nature of the job and the payload which is a key value map of serializable objects. In Sling jobs,we create 1.Job Producer 2. Job Consumer Job producer gets created with job name in /var/eventing/unassigned Job consumer gets created with job name in /var/eventing/assigned
  • 11. Job Producer (Syntax) @Component public class Jobs { @Reference private JobManager jobManager; public void startJob() { final Map<String, Object> props = new HashMap<String, Object>(); props.put("item1", "/something"); props.put("count", 5); jobManager.addJob("sling/orderedtest/start", props); } }
  • 12. Job Consumer (Syntax) @Component @Service(value={JobConsumer.class}) @Property(name=JobConsumer.PROPERTY_TOPICS, value="my/special/jobtopic",) public class MyJobConsumer implements JobConsumer { public JobResult process(final Job job) { // process the job and return the result return JobResult.OK; } } You can create your own queue in felix console by Apache Sling job Queue Configuration
  • 13.
  • 14. References References for SchedulersReferences for Schedulers ● Scheduler-jobs examples ● Schedulers in AEM ● aem-adobecq5-code-templates- scheduler References for Cron ExpressionsReferences for Cron Expressions ● Cron Trigger Explanation ● Cron Making Examples ● Cron Maker Online Tool