The Kafka
transport uses a publish or a subscribe Message Exchange Pattern (MEP). When you create a test by
using MEP, the test contains a publish or a subscribe action as required. You can specify the
default options for publish actions with or without the subscribe action by using the settings on
the Message Exchange Pattern tab.
Procedure
-
Open the Operation configuration panel and select the Message
Exchange Pattern tab.
-
Choose the Publish/Subscribe pattern. You can choose only the
Publish or Subscribe pattern, if you want.
-
Click the Publish tab, if it is not already open.
-
Complete the following steps in the Publish tab:
-
Click Browse and select Kafka as the
required transport in the Select a Resource dialog box.
-
Select from the following options for the action you want:
Option |
Action |
No |
If you select No, you can select any transport in the project. |
Yes |
If you select Yes, you can select only transports that are referenced
(directly or indirectly) by the operation that contains the test. |
Only Direct |
If you select Only Direct, you can select only transports that are
referenced directly by the operation that contains the test. |
-
In the Topic field, enter the name of the topic to which the message is
to be published.
-
In the PartitionID field, enter the partition ID of the Topic to which
the message is to be published.
-
Click the Subscribe tab.
-
Complete the following steps in the Subscribe tab:
-
Click Browse and select Kafka as the
required transport in the Select a Resource dialog box.
-
Select from the following options for the action you want:
Option |
Action |
No |
If you select No, you can select any transport in the project. |
Yes |
If you select Yes, you can select only transports that are referenced
(directly or indirectly) by the operation that contains the test. |
Only Direct |
If you select Only Direct, you can select only transports that are
referenced directly by the operation that contains the test. |
-
Click OK when finished.
-
In the Topic field, enter the name of the topic on the Kafka server
from which the message is to be subscribed.
-
In the GroupID field, enter the subscriber group ID that you have
created for the subscriber group. The subscriber must be a member of the subscriber group.
-
In the Auto Offset Reset list, select any option from the following
options:
Option |
Description |
Earliest |
Automatically resets the offset to the earliest offset. |
Latest |
Automatically resets the offset to the latest offset. |
None |
Displays an error to the subscriber if no previous offset is found for the subscriber group
to which the subscriber belongs. |
-
Click OK to save the MEP settings and exit from the operation settings
window.