Coder Social home page Coder Social logo

madhur4127 / rabbitmq-last-value-per-topic-queue Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 102 KB

A plugin for RabbitMQ that enables creation of queues that only store and send the last received value per topic

License: MIT License

Makefile 10.74% Erlang 85.35% Python 3.92%

rabbitmq-last-value-per-topic-queue's Introduction

RabbitMQ last key value queue

This code provides new type of queue, which is replaces elements in queue by key. It is helpful to update queue by newest elements (some ticks, real-time data and etc).

Example of work:

Presentation of queue is [ Head, SecondElement, ... LastElememt ]

Head is going to as next data for consumers

Initial state:

{key_1, value_1},{key_2, value_2},

Step 1: Add new non existed element {key_3, value_3} :

{key_1, value_1}, {key_2, value_2}, {key_3, value_3}

Step 2: Updating element {key_1, new_value_1}:

{key_2, value_2}, {key_3, value_3}, {key_1, new_value_1}

Usage

Initialisation

Before using you must define this queue. Queue will be created by this module if you will provide specific key for argument (options) of creation command: x-last-value-per-topic = 'enabled'

Puting of element

You must provide key of element in routing_key options within putting operation.

Examples of code

All examples of python's code for usage this queue (and tests) are available in test folder.

Installation instructions

Easiest thing to do is to:

  • make run-broker from above, check that you see "started with 1 plugins", then stop the process
  • copy plugins/rabbit_topic_last_value_queue-[version].ez in to the plugins directory for your installation (usually /usr/lib/rabbitmq/plugins/)
  • you should now see the plugin when you do rabbitmq-plugins list and can enable/disable it using that tool

If you need any more info in installing plugins and/or troubleshooting then refer to:

Testing

See test/TEST_PLAN.md

Launching of test

  1. make run-broker <- start RMQ
  2. go to python folder and start consumer.py and producer.py

Authors

Sergey Loguntsov [email protected]

Mark Hingston [email protected]

rabbitmq-last-value-per-topic-queue's People

Contributors

loguntsov avatar mrkhingston avatar

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.