🧠
Simple, Typed API
Publish and consume strongly typed events with full TypeScript safety.
Fast. Typed. Resilient.
import { RabbitMQBroker, event } from "@bitspacerlabs/rabbit-relay";
const broker = new RabbitMQBroker("payments-service");
const charge = event("payments.charge", "v1").of<{
orderId: string;
amount: number;
}>();
const pub = await broker
.queue("payments_queue")
.exchange("payments", { exchangeType: "topic" });
await pub.produce(
charge({ orderId: "ORD-1", amount: 99.5 })
);