Git Product home page Git Product logo

edison-jobtrigger's Introduction

Edison Microservice is a library to write production-ready Microservices on top of Spring Boot. It is actively used at otto.de.

Because Microservices should be loosly coupled, they often need to import data from other systems - at least in our architecture. To make such kind of background jobs as easy to implement as possible, and to run them on a regular base in clustered environments, we need a component that is triggering these jobs as needed: that's the purpose of

Edison JobTrigger

All Edison Microservices may announce JobDefinitions: specifications about jobs telling a JobTrigger (or other tools) how a Job is triggered, in what frequency this should happen, and so on.

If a JobTrigger server is configured, the Microservice will register itself at startup and, in the following, update this registration every few minutes. The JobTrigger is querying all supported JobDefinitions and will trigger the jobs of all registered Microservices according to their definition.

Edison JobTrigger supports multiple services from different groups (or Teams) in multiple environments (test, prelive, live...).

That's it.

Usage

gradlew build
java -jar build/libs/edison-jobtrigger-2.0.0.jar

Write an Edison Microservice (or simply use Example-Jobs as an example) including some jobs and job definitions.

Configure some additional properties in your service:

edison.servicediscovery.servers=http://localhost:8080/jobtrigger # where to find the JobTrigger
edison.servicediscovery.service=http://localhost:${server.port}/${server.context-path} # where to find the service
# Optionally override defaults:
# edison.servicediscovery.expire-after=15 # expire the registration of the service after N minutes.
# edison.servicediscovery.refresh-after=5 # reload JobDefinitions after N minutes
# edison.servicediscovery.environment=unknown # the environment of the service (live, develop, ...)
# edison.servicediscovery.group=default # the group of the services. In our case it's the name of a team

Run JobTrigger + your service(s). After some time (one minute), JobTrigger will find the JobDefinitions of your services and start the triggers accordingly.

Discovery

Because JobTrigger has no persistency, Services have to re-register every few minutes: this is the purpose of property edison.servicediscovery.expire-after.

The known services and their JobDefinitions can be seen on the Discovery page: Discovery

Triggers

Because services can be deployed at any time, the JobTrigger will load current JobDefinitions every few minutes. The interval is configured using edison.servicediscovery.refresh-after.

After a while, you can see the triggered jobs on the Trigger page: Triggers

Job Information

You can access the asynchronously running job by opening the messages: Job Messages

Have fun!

edison-jobtrigger's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.