@gbuilder/rabbitmq-js
v0.1.1
Published
RabbitMQ integration
Downloads
2
Readme
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')