Skip to content

messaging/producer

Documentation

Overview

Classes

Producer

queue()

Creates a Queue producer instance for point-to-point messaging. Messages sent to this destination are intended to be consumed by a single receiver.

ts
static queue(destination: string): Queue;
ParameterTypeDescription
destinationstringThe name of the queue destination (e.g., 'task.queue').

Returns

  • Type: Queue
  • Description: A Queue instance.

topic()

Creates a Topic producer instance for publish/subscribe messaging. Messages sent to this destination can be consumed by multiple subscribers simultaneously.

ts
static topic(destination: string): Topic;
ParameterTypeDescription
destinationstringThe name of the topic destination (e.g., 'sensor.data.topic').

Returns

  • Type: Topic
  • Description: A Topic instance.