kafka/producer
Documentation
- source: kafka/producer.ts
Overview
Classes
Producer
topic()
Creates a new topic configuration wrapper that can be used to send messages to a specific Kafka topic.
tsstatic topic(destination: string, configuration: any): Topic;
Parameter Type Description destinationstringThe name of the Kafka topic to send messages to. configurationanyOptional key-value object containing Kafka producer properties
(e.g., 'bootstrap.servers', 'acks'). |
Returns
- Type:
Topic- Description: A Topic instance configured for the specified destination and properties.
close()
Closes the Kafka producer connection pool, releasing associated resources. This should be called when message sending is complete to ensure proper cleanup.
tsstatic close(configuration: any): void;
Parameter Type Description configurationanyOptional key-value object containing the configuration
used to initialize the producer to be closed. |
Returns
- Type:
void- Description:
