Class: Connection
October 16, 2025 ยท View on GitHub
Class: Connection
Defined in: index.d.ts:408
Classdesc
Connection connects to Kafka for working with topics.
Example
// In init context
const connection = new Connection({
address: "localhost:9092",
});
// In VU code (default function)
const topics = connection.listTopics();
// In teardown function
connection.close();
Constructors
Constructor
new Connection(
connectionConfig):Connection
Defined in: index.d.ts:415
Parameters
connectionConfig
Connection configuration.
Returns
Connection
- Connection instance.
Methods
close()
close():
void
Defined in: index.d.ts:441
Returns
void
- Nothing.
Destructor
Description
Close the connection.
createTopic()
createTopic(
topicConfig):void
Defined in: index.d.ts:422
Parameters
topicConfig
Topic configuration.
Returns
void
- Nothing.
Method
Create a new topic.
deleteTopic()
deleteTopic(
topic):void
Defined in: index.d.ts:429
Parameters
topic
string
Topic name.
Returns
void
- Nothing.
Method
Delete a topic.
listTopics()
listTopics():
string[]
Defined in: index.d.ts:435
Returns
string[]
- Topics.
Method
List topics.