@gbuilder/rabbitmq-js
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

rabbitmq-js

RabbitMQ integration for JavaScript

Usage


const { RabbitMQ } = require('rabbitmq-js');
// Or with TypeScript: 
// import { RabbitMQ } from 'rabbitmq-js';

const logger = await RabbitMQ({
    projectId: 'materialdb',
    url: amqp://localhost,
    exchangeId: 'materialdb',
});

logger.publishEvent('material', 'edit', { ... }, 'gbuilder');

Logger methods

publishEvent

publishEvent(entityType, actionType, data, org = 'common')

Publish an event

Arguments

entityType (string, required)

  • Type of the entity (e.g. 'material', 'manufacturer', 'label')

actionType (string, require)

  • Type of the action (e.g. 'create', 'edit', 'delete')

data (object, required)

  • Event-specific data

organization (string, optional)

  • Organization ID related to the event (e.g. 'gbuilder')

Readme

Keywords

none

Package Sidebar

Install

npm i @gbuilder/rabbitmq-js

Weekly Downloads

5

Version

0.1.1

License

ISC

Unpacked Size

11.5 kB

Total Files

11

Last publish

Collaborators

  • gbuilder