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. |
-
Click OK.
-
Click the Kafka Properties tab and complete the following
steps:
- Enter the name of the topic to which the message is to be published in the
Topic field.
- Enter the partition ID of the Topic to which the message is to be published in
the PartitionID field.
-
Click the Parameters tab and complete the following
steps:
- Click the Add Parameter icon .
The New Property dialog is displayed.
- Enter the name of the parameter that you want to use in the
Name field.
- Enter the value of the parameter in the Value
field.
- Click OK to save the parameter.
-
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.
-
Click the Kafka Properties tab and complete the following
steps:
- Enter the name of the topic to which the message is to be published in the
Topic field.
- Enter the subscriber group ID in the GroupID field that
you have created for the subscriber group. The subscriber must be a member of
the subscriber group.
- Select any option from the following options in the Auto Offset
Reset list:
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.