system.kafka.pollTopic
This function is used in Python Scripting.
Description​
Returns a list of records from the specified topic.
Client Permission Restrictions​
This scripting function has no Client Permission restrictions.
Syntax​
system.kafka.pollTopic(connector, topic, groupId, [options], sizeCutoff, timeoutMs)
Parameters​
| Type | Parameter | Description |
|---|---|---|
| String | connector | The name of the Kafka connector. |
| String | topic | The name of the Kafka topic. |
| String | groupId | The unique string of the consumer group the consumer belongs to. |
| Dictionary | options | Custom options specific to the consumer, with key value string pairs. Optional. |
| Integer | sizeCutoff | New in 8.3.3 The total record count allowed before polling will be stopped. |
| Long | timeoutMs | New in 8.3.3 The amount of time in milliseconds before polling will be stopped. |
Returns​
List - A list of records from the specified topic.
Scope​
Gateway
Code Examples​
Example #1
# Returns a list of records from the specified topic.
system.kafka.pollTopic("MyKafkaConnector", "MyKafkaTopic", "consumer-group-one")