Options
All
  • Public
  • Public/Protected
  • All
Menu

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.

Hierarchy

  • TopicProducer

Index

Constructors

Properties

Methods

Constructors

constructor

  • 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

Private inner

Methods

sendRecord

  • sendRecord(data: string, partition: number): Promise<void>
  • sendRecord(data: string, partition: number): Promise<void>
  • Parameters

    • data: string
    • partition: number

    Returns Promise<void>

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

    Parameters

    • data: string
    • partition: number

    Returns Promise<void>

Static create

  • 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

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Private property
  • Private method
  • Static method

Generated using TypeDoc