RabbitMQ library written in TypeScript. Responsible for brokering messages between different services.
npm i @togethercrew.dev/tc-messagebroker
import RabbitMQ from '@togethercrew.dev/tc-messagebroker';
RabbitMQ.connect("connectionURL", "queueName").then(() => {
console.log("RabbitMQ was connected!")
})
import RabbitMQ from '@togethercrew.dev/tc-messagebroker';
RabbitMQ.publish("queueName", "eventName", { key: "value" })
import RabbitMQ from '@togethercrew.dev/tc-messagebroker';
RabbitMQ.onEvent("eventName", (msg) => {})
Ensure that the
onEvent
function is called when the application is launched