API: producer
Source:
messaging/producer.ts
Provides an API for producing (sending) messages to JMS-style destinations, supporting both Queues (point-to-point) and Topics (publish/subscribe).
Usage
import { producer } from "sdk/messaging"
producer.queue("queue1").send("Text Message");Classes
Producer
The entry point for creating messaging producers.
Use this class to obtain instances of Queue or Topic producers for sending messages.
Methods
queue
queue (destination:string):QueueCreates a Queue producer instance for point-to-point messaging.
Messages sent to this destination are intended to be consumed by a single receiver.
@param destination The name of the queue destination (e.g., 'task.queue').
@returns A {@link Queue} instance.
topic
topic (destination:string):TopicCreates a Topic producer instance for publish/subscribe messaging.
Messages sent to this destination can be consumed by multiple subscribers simultaneously.
@param destination The name of the topic destination (e.g., 'sensor.data.topic').
@returns A {@link Topic} instance.
Queue
Represents a producer for a Queue destination (point-to-point).
Methods
send
send (message:string):voidSends a message to the configured queue destination.
@param message The content of the message to send (typically a string or serialized object).
Topic
Represents a producer for a Topic destination (publish/subscribe).
Methods
send
send (message:string):voidSends a message to the configured topic destination. All active subscribers will receive the message.
@param message The content of the message to publish (typically a string or serialized object).