Code Monkey home page Code Monkey logo

keiko's Introduction

Keiko

Keiko is a simple, at-least-once queueing library originally built for Spinnaker's Orca µservice.

Concepts

Keiko consists of a number of components:

The Queue

The queue itself accepts unique messages with an associated delivery time/ By default the delivery time is immediate but messages may be pushed for delivery at any point in the future.

The QueueProcessor

Polls the queue for messages and hands them off to the appropriate MessageHandler according to the message type. The QueueProcessor uses a single thread to poll the queue and invokes message handlers using a thread pool.

Using

Include com.netflix.spinnaker.keiko:keiko-redis:<version> in your build.gradle file.

Implement message types and handlers extending com.netflix.spinnaker.q.Message and com.netflix.spinnaker.q.MessageHandler respectively.

Using in a Spring Boot application

Include com.netflix.spinnaker.keiko:keiko-redis-spring:<version> in your build.gradle file. It will pull keiko-redis in transitively so there is no need to declare dependencies on both modules.

Implementing messages and handlers

For each message type you should implement a Message and a MessageHandler. A MessageHandler can also handle a heirarchy of message types.

Message implementations should be immutable value types. Kotlin data classes, Java classes annotated with Lombok's @Value, or just simple POJOs are ideal.

MessageHandler implementations may push other messages to the queue. Messages should be processed quickly. If processing time exceeds the ackTimeout value specified on the queue or an unhandled exception prevents the handler from returning normally, the message will get re-queued.

Handlers may re-push the same message they are processing in order to implement polling workflows.

Configuring the queue in Spring Boot

Telemetry

Developing a new queue implementation

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.