Skip to content

Overview

Development

Overview

IDEs

API Explorer

KafkaClientsMethods

The KafkaClientsMethods class contains one-liners for interacting with Kafka, such as creating Kafka producers and sending messages to a topic. Below is a snippet showing how to use KafkaClientsMethods' instance extension methods:

Sample Gloop service showing how to use the `KafkaClientsMethods` one-liners

1
2
3
4
5
// Creates Kafka producer that is used for publishing messages 
def producer = "localhost:9092".createProducer("LONG", "STRING")

// Publish message to 'stocks' topic 
producer.send("stocks", 123456, "APL")