Run Kafka messages

Tricentis Tosca API Scan enables you to run messages using an Apache Kafka connection. A Kafka topic stores records, i.e. 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 for a distribution of large amounts of data on one or more servers.

Producers are responsible for publishing records in a topic. Consumers read these records. Each consumer is part of a consumer group that subscribes to a topic. You can select whether you want to publish records or consume records, i.e. if you want to pull messages from a Kafka topic or push messages to a Kafka topic.

After running your Kafka records in API Scan, you can export them to Tosca Commander and use the record information to define Module Attributes and verify their values. Depending on your tests, you have to export the records either as an API TestCase or as an OSV Scenario. It is not possible to convert a Kafka TestCase into a Kafka Scenario, or vice versa.

You can not export Kafka records 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.

Pull records

To pull records from a Kafka topic, follow the steps below:

  1. Create a message from a URI or file, or create a new message.

  2. Select a Kafka connection from the Connection dropdown menu.

  3. Select Pull from the Action dropdown menu.

  4. You can specify a partition offset to pull records from a specific point on. An offset defines the position of a record in the partition and depends on the order in which the records were committed. By specifying an offset, you can define whether to start reading older records, for instance, or to begin with the newest one. By default, API Scan pulls the last unread record.

    To specify the offset, enter a number into the Partition Offset field. To start with the first record, enter the value 0.

Configure Connection, Action, and Partition Offset

  1. Click on Run in the API Scan menu to pull a record from the topic.

Response of a pull message

Push records

To push records to a Kafka topic, follow the steps below:

  1. Create a message from a URI or file, or create a new message.

  2. Select a Kafka connection from the Connection dropdown menu.

  3. Select Push from the Action dropdown menu.

Select Connection and Action

  1. Click on Run in the API Scan menu to push your record to the topic.

The response indicates if the record was pushed to the topic successfully.

Response of a push message