Class TopicProducer

Topic Producer

Overview

An interface for producing events to a particular topic

A TopicProducer allows you to send events to the specific topic it was initialized for. Once you have a TopicProducer, you can send events to the topic, choosing which partition each event should be delivered to.

Example Construction

Do not construct this manually, instead use the following method:

const fluvio = new Fluvio({ host, port })

await fluvio.connect();

const producer = await fluvio.topicProducer("topic-name")

This class constructor is used internally by the Fluvio client to provision a topic producer.

The inner object is a private object that is the native module created by the top-level Fluvio client.

This class is not intended to be constructed manually.

Constructors

Properties

Methods

Constructors

  • Private constructor

    This method is not intended to be used directly. This is a helper method used by the Fluvio class to pass in a native object, along with top-level Fluvio client options, if any.

    Parameters

    • inner: TopicProducer

      The native node module created by await (new Fluvio().connect()).topicProducer()

    Returns TopicProducer

Properties

Methods

  • Returns Promise<void>

  • Returns Promise<void>

  • Sends a key-value event to this producer's topic

    Parameters

    • key: ProducerItem

      The Key data of the record to send

    • value: ProducerItem

      The Value data of the record to send

    Returns Promise<void>

  • Sends a key-value event to this producer's topic

    Parameters

    • key: string | ArrayBuffer

      The Key data of the record to send

    • value: string | ArrayBuffer

      The Value data of the record to send

    Returns Promise<void>

  • Sends a list of key-value elements to this producer's topic

    Parameters

    Returns Promise<void>

  • Sends a list of key-value elements to this producer's topic

    Parameters

    Returns Promise<void>

  • Sends an event to a specific partition within this producer's topic

    Parameters

    • data: string
    • partition: number

      The partition that this record will be sent to

    Returns Promise<void>

  • Sends an event to a specific partition within this producer's topic

    Parameters

    • value: string

      Buffered data to send to the Fluvio partition

    • partition: number

      The partition that this record will be sent to

    Returns Promise<void>

  • Factory method for creating a new topic Producer; This method is used by the Fluvio class. It is not meant to be called directly;

    Parameters

    • inner: TopicProducer

      The native node module created by await (new Fluvio().connect()).topicProducer()

    Returns TopicProducer

Generated using TypeDoc