Nominal Pizza Masticator

    queue-adapter

    0.1.0 • Public • Published

    nodejs-queue-adapter

    Build Status Test Coverage

    Provides a simple interface to a variety of message queues

    Installation

    npm install queue-adapter

    Supported Services

    Usage

    A more extensive documentation will be added shortly, please have a look at the tests so far

    Basic Javascript

    var adapter = require('queue-adapter').create('sqs');
     
    adapter.produce("my-queue", {foo: "bar"});
     
    adapter.consume("my-queue", function(job){
        console.log(job.getPayload()); //prints {foo: "bar"}
     
        job.delete().then(function(){
            jod.done();
        });
    });

    Simple Configuration

    var sqsAdapter = require('queue-adapter').create('sqs');
    var activeMqAdapter = require('queue-adapter').create('activemq');
    var beanstalkdAdapter = require('queue-adapter').create('beanstalkd');
    var rabbitMqAdapter = require('queue-adapter').create('rabbitmq');

    Advanced Typescript

    var adapter = require('queue-adapter').create('sqs');
     
    adapter.produce("my-queue", {foo: "bar"})
        .then(function(){
            console.log("Message sent");
        })
        .catch(function (error) {
            console.log(error);
        });
     
    adapter.consume("my-queue", function(job: IJob){
        console.log(job.getPayload()); //prints {foo: "bar"}
     
        job.delete().then(function(){
            jod.done();
        });

    Install

    npm i queue-adapter

    DownloadsWeekly Downloads

    0

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • 21stio