@coding-blocks/whisperer
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

Whisperer

An event sourcing over AMQP library using STOMP.

Getting Started

  • Whisperer uses AMQP backends with STOMP plugin such as RabbitMQ
  • Enable STOMP plugin in RabbitMQ using rabbitmq-plugins enable rabbitmq_stomp
  • Enable STOMP web plugin in RabbitMQ to enable websocket interation rabbitmq-plugins enable rabbitmq_web_stomp

Installation

  • If using npm npm install @coding-blocks/whisperer
  • If using yarn yarn add @coding-blocks/whisperer

Usage

  • Create a whisperer object
import Whisperer from "@coding-blocks/whisperer";

const whisperer = new Whisperer({
  host: '127.0.0.1',
  port: 15674,
  username: 'guest',
  password: 'guest'
});

await whisperer.init()
  • To Subscribe to topics
  whisperer.on('oneauth_user.created', (msg, frame) => {
    console.log("listener 2: <created>", msg)
    frame.ack()
  })
  • To emit messages
  whisperer.emit('oneauth_user.created', {
    body: {
      data: 'some create message'
    }
  })

Readme

Keywords

none

Package Sidebar

Install

npm i @coding-blocks/whisperer

Weekly Downloads

0

Version

0.0.7

License

ISC

Unpacked Size

9.53 kB

Total Files

13

Last publish

Collaborators

  • bipinkalra
  • jatinkatyal13
  • abhishek97
  • vdvibhu20
  • witty123
  • championswimmer