Consume test messages from a Hermes topic using the Kafka client
- UpdatedAug 1, 2024
- 2 minutes to read
- Xanadu
- Now Platform Capabilities
Consume test messages from a Hermes topic by configuring two consumer clients.
Before you begin
- Secure your Kafka topics by generating a ServiceNow® instance-signed certificate and keystore. You must provide truststore and keystore details when you configure the Hermes consumers. See Set up a secure connection to the Hermes Messaging Service.
- Download and install Apache Kafka. See Prepare your Apache Kafka client environment.
- Create a topic and produce test messages in the Hermes Kafka cluster before you can consume messages. For details, see Create a test topic in Hermes using the Kafka client and Produce test messages to a Hermes topic using the Kafka client.
Role required: admin
About this task
The following steps describe how to configure two consumer clients and receive test messages from the Hermes Kafka cluster. Because Hermes uses a pair of Kafka clusters, you must configure two consumer clients with separate consumer bootstrap addresses. This ensures messages are consumed from both clusters without dropping any messages.
Important: You must configure two distinct consumer bootstrap addresses, one for each consumer client.
Refer to these steps when you are ready to consume messages from Hermes for business or production purposes.
Procedure
-
Navigate to the config directory where you extracted Kafka.
- For example, on Unix:
cd /home/user/Software/kafka/config - For example, on Windows:
cd C:\Software\kafka\config
- For example, on Unix:
-
Configure the consumers.
-
Consume a message using each consumer.
Result
Test messages are consumed from the Hermes Kafka cluster.