Run Kafka messages
Tricentis Tosca API Scan enables you to run messages using an Apache Kafka connection. A Kafka topic stores messages, such as messages, that are sent by one or more publishers and read by one or more consumers. This allows different systems to communicate independently, for instance if one of them is offline. Furthermore, Kafka topics can be split into multiple partitions. This allows large amounts of data to be distributed across one or more servers.
Producers are responsible for publishing messages in a topic. Consumers read these messages. Each consumer is part of a consumer group that subscribes to a topic. You can select to publish or consume messages, for example, when you want to pull messages from a Kafka topic or push messages to a Kafka topic.
After running your Kafka messages in API Scan, you can export them to Tosca Commander and use the message information to define Module Attributes and verify their values.
![]() |
You cannot export Kafka messages directly from API Scan to OSV. You have to export them to Tosca Commander first and set the correct ActionModes manually before uploading to OSV. |
![]() |
Authentication with the Kafka connection uses the SASL/PLAIN mechanism. The Kafka connection is only available when SASL/PLAIN authentication is enabled. |
Pull messages
To pull messages from a Kafka topic, follow the steps below:
-
Create a message from a URI or file, or create a new message.
-
Select a Kafka connection from the Connection dropdown menu.
-
Select Pull from the Action dropdown menu.
-
You can specify a partition offset to pull a message from a specific point. An offset defines the position of a message in the partition and depends on the order in which the messages were committed. By default, API Scan pulls the last unread message.
To specify the offset, enter a number into the Partition Offset field. To start with the first message, enter the value 0.
Configure Connection, Action, and Partition Offset
-
You can specify a Timestamp in milliseconds to pull a message with the specified timestamp or the first message after the specified time. You always get the same message.
-
Click on
Run in the API Scan menu to pull a message from the topic.
Response of a pull message
Push messages
To push messages to a Kafka topic, follow the steps below:
-
Create a message from a URI or file, or create a new message.
-
Select a Kafka connection from the Connection dropdown menu.
-
Select Push from the Action dropdown menu.
Select Connection and Action
-
Click on
Run in the API Scan menu to push your message to the topic.
The response indicates whether the message was successfully pushed to the topic .
Response of a push message