Coder Social home page Coder Social logo

rx-amqplib's Introduction

RxJS wrapper for amqplib

rx-amqplib is a wrapper for using the squaremo amqplib NodeJS package with RxJS.

Gettings started

To include this library in your project, all you need to do is install it using NPM.

$ npm install rx-amqplib --save

Examples

Here is a basic example of creating a connection to a RabbitMQ server, creating a channel + queue and sneding a message to the queue.

const config = {
  queue: 'test_queue',
  host: 'amqp://localhost'
};

// Process stream
RxAmqpLib.newConnection(config.host)
  .flatMap(connection => connection
    .createChannel()
    .flatMap(channel => channel.assertQueue(config.queue, { durable: false }))
    .doOnNext(reply => reply.channel.sendToQueue(config.queue, new Buffer('Test message')))
    .flatMap(reply => reply.channel.close())
    .flatMap(() => connection.close())
  )
  .subscribe(() => console.log('Message sent'));

More Examples

  1. Hello World

    Server, Client

    The simplest thing that does something.

  2. Work Queues

    New task, Worker

    Distributing tasks among workers

  3. Publish/Subscribe

    Emit logs, Receive logs

    Sending messages to many consumers at once

  4. Routing

    Emit log, Receive logs

    Receiving messages selectively

  5. Topics

    Emit log, Receive logs

    Receiving messages based on a pattern

  6. RPC

    RPC Server, RPC Client

    Remote procedure call implementation

Build it Yourself

Should you wish to build the library yourself, either for personal use, or for contribution, please ensure there are no errors emitted during the build process with npm run build.

$ git clone [email protected]:SkippyZA/rx-amqplib.git
$ cd rx-amqplib
$ npm install
$ npm run build

rx-amqplib's People

Contributors

skippyza avatar cboden avatar shaunegan avatar

Watchers

James Cloos avatar  avatar  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.