produceFromTable
produceFromTable writes a Kafka stream from an in-memory table.
Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
| options | KafkaPublishOptions | Kafka publishing options that include the source table, properties, string, key and value specifications, and whether or not to perform a |
| table | Table | The table to use as the source of data for Kafka. |
| kafkaProperties | Properties | Properties to be passed to create the associated producer. |
| topic | String | The Kafka topic name. |
| keySpec | KeyOrValueSpec | Conversion specification for Kafka record keys from table column data. |
| valueSpec | KeyOrValueSpec | Conversion specification for Kafka record values from table column data. |
| lastByKeyColumns | boolean | Whether to publish only the last record for each unique key. Ignored when |
Returns
A callback to stop producing and shut down the associated table listener.
Examples
In the following example, produceFromTable is used to write to the Kafka topic testTopic from a Deephaven table.
In the following example, produceFromTable is used to write the Kafka topic with lastByKeyColumns as true. This indicates we want to perform a lastBy with the specified key columns before publishing the data.