Queue sender interface for dispatching messages to a queue.
Each IQueueSender instance is bound to a specific queue name. Messages are dispatched with auto-generated id, timestamp, and locale metadata.
// Injected via @InjectQueue or token bindingconstructor( @InjectQueue('notifications-queue') private queue: IQueueSender) {}// Dispatch a messageawait this.queue.dispatch({ type: 'email.send', payload: { to: 'user@example.com', subject: 'Welcome', html: '<h1>Hello!</h1>' }}) Copy
// Injected via @InjectQueue or token bindingconstructor( @InjectQueue('notifications-queue') private queue: IQueueSender) {}// Dispatch a messageawait this.queue.dispatch({ type: 'email.send', payload: { to: 'user@example.com', subject: 'Welcome', html: '<h1>Hello!</h1>' }})
Dispatch a message to this queue.
Auto-adds:
id
timestamp
metadata.locale
Message to dispatch (without id/timestamp)
Queue sender interface for dispatching messages to a queue.
Each IQueueSender instance is bound to a specific queue name. Messages are dispatched with auto-generated id, timestamp, and locale metadata.
Example