system.kafka.seekLatest
This function is used in Python Scripting.
Description​
Retrieves the last N number of records from a specified topic.
Client Permission Restrictions​
This scripting function has no Client Permission restrictions.
Syntax​
system.kafka.seekLatest(connector, topic, partition, recordCount, [options])
Parameters​
Type | Parameter | Description |
---|---|---|
String | connector | The name of the Kafka connector. |
String | topic | The name of the Kafka topic. |
Integer | partition | The partition to target. |
Integer | recordCount | The number of records to return. |
Dictionary | options | Custom options specific to the consumer, with key value string pairs. Optional. |
Returns​
List - An N number of records from a specified topic, as a list.
Scope​
Gateway
Code Examples​
Example #1
# Returns the latest 5 records from the specified topic.
system.kafka.listTopics("MyKafkaConnector", "MyKafkaTopic", 3, 5)