Skip to content

A simulation of an automated order fulfillment system using JobRunr

Notifications You must be signed in to change notification settings

jobrunr/example-order-fulfillment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JobRunr example

This repository shows a simple example on how you can integrate JobRunr with spring.io. Other examples using spring.io can be found here and here.

In this example, we simulate an order fulfillment system. For this example, the fulfillment process starts after the customer completed the payment. This triggers the three following tasks:

  • Send the order confirmation to the customer
  • Notify the warehouse of the arrival of the order so work on the packaging can be swiftly done
  • Initiate shipment by making a call to the carrier's booking API

Other tasks such as creating a sales report or resupplying the inventory are re-occurring and are best handled as RecurringJobs.

This example is focused on JobRunr side of things, we leave the implementation of object such as the Inventory, the Order, the Product, etc. as an exercise. Also the running of tasks is simulated by Thread.sleep(...) which implies explicit handling of InterruptedException, you probably won't need those in an actual application.

About this project

This project has 4 packages:

  • org.jobrunr.examples.config: this package register the OrderFulfilmentTasksFilter
  • org.jobrunr.examples.controllers: this package contains a simple RestController called OrderFulfillmentController, which declares an endpoint to trigger the order fulfillment workflow
  • org.jobrunr.examples.services: this package contains OrderFulfillmentService, a simple spring service with example order fulfillment methods.
  • org.jobrunr.examples.tasks: this package contains OrderFulfillmentTasks which declares the Jobs for JobRunr to process using the handy annotations
    • Note that the method annotated with @Recurring will be automatically picked up by JobRunr

How to run this project:

About

A simulation of an automated order fulfillment system using JobRunr

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages