---
sourceDocument: Brazil ServiceNow AI Platform Capabilities
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/servicenow-platform

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil ServiceNow AI Platform Capabilities

ft:clusterId :

    - platcap

bundleId :

    - platcap

workflow :

    - Platform


---

# Produce and consume messages

# Producing and consuming messages from a Kafka client {#ariaid-title1}

Release version: Brazil  
Updated September 10, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 3 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of Producing and consuming messages from a Kafka client

This guide explains how ServiceNow customers can produce and consume messages using Hermes, ServiceNow's Kafka-based messaging service.
It details the setup required to communicate with Hermes Kafka clusters, emphasizing the need for multiple processes and specific network configurations to ensure reliable message exchange and failover support.
Show full answer Show less  

## Key Requirements and Setup

* **Topic creation:** Start by creating a topic in the Hermes Kafka cluster to enable message exchange.
* **Processes needed:**
  * One producer process to send messages to Hermes.
  * Two consumer processes to receive messages, required due to Hermes using a pair of Kafka clusters for failover.
* **Distinct consumer configurations:**
  * Each consumer must connect to a different bootstrap address and use distinct port ranges (4100-4150 for the first consumer, 4200-4250 for the second).
  * Producers connect over port range 4000-4050.
* **Network ports:** Open and verify access to the following port ranges before communication:
  * Producer: 4000-4050
  * Consumer 1: 4100-4150
  * Consumer 2: 4200-4250
* **No proxy support:** Hermes requires native Kafka TCP connections; proxy configurations on MID Servers do not support Kafka traffic and should not be relied upon.

## Connectivity and Configuration Details

* **Bootstrap addresses:** Use the specified port mappings for producer and consumer clients to connect to Hermes Kafka clusters. For example, producers connect to `<instancename>.service-now.com:4000` through `:4050`, while the two consumers connect separately via ports in the 4100-4150 and 4200-4250 ranges.
* **Failover design:** Hermes operates with two Kafka clusters to ensure high availability. Data is produced to both clusters, necessitating two consumer clients to cover both clusters for message consumption.

## Using Command-Line Interface (CLI)

* The `list` command shows topics from one or both Kafka clusters; synchronization timing may affect results.
* Topics include system/internal topics and user-created topics distinguished by cluster prefix codes.
* Topic deletion requires deleting records within the ServiceNow instance; a single CLI command cannot remove topics from both Kafka clusters simultaneously.

## Practical Implications for ServiceNow Customers

By following these instructions, ServiceNow customers can reliably integrate their Kafka clients with Hermes for scalable and fault-tolerant message production and consumption. Ensuring correct port access and configuring multiple consumer clients for failover clusters is critical to maintaining uninterrupted message flow. Additionally, customers should plan topic management and network configurations with their administrators to avoid connectivity issues and leverage Hermes effectively.  
Learn how to produce and consume messages to Hermes from a Kafka client.

To begin exchanging messages from a Kafka client, start by creating a topic in the Hermes Kafka cluster. After you successfully create the topic, you must create a total of three processes to communicate with Hermes.

* One process is required to produce messages to Hermes.
* Two processes are required to consume messages from Hermes. Two processes are required because Hermes uses a pair of Kafka clusters for failover purposes. If one cluster goes down, data is produced to the other Hermes Kafka cluster.  
  Important:  
  You must configure two distinct consumer bootstrap addresses, one for each consumer client.

{#producing-consuming-hermes__ul_b53_brp_twb}

One consumer process uses ports in the 410x range and the other uses ports in the 420x range. This means you must define two distinct clients, one for each port range. Within each client configuration, you can define consumer group
IDs.

## Required port ranges {#producing-consuming-hermes__section_wfs_cdb_1zb}

Work with your network administrator to ensure that the following port ranges are open before you begin exchanging messages using Hermes:

* Producer: 4000-4050
* Consumer1: 4100-4150
* Consumer2: 4200-4250
{#producing-consuming-hermes__ul_ijs_gdb_1zb}  
Note:  
Proxy usage is not supported for Hermes connectivity. Hermes uses Kafka-native TCP connections (not HTTP). Therefore, proxy settings configured on a MID Server are ignored and don't provide a supported path to reach the Hermes cluster. The MID Server proxy configuration applies only to HTTP-based communication and does not apply to Kafka traffic. This applies to all applications that connect to Hermes, including Log Export Service and Stream Connect.

To confirm that the ports are accessible through the firewall, run the following command:

    openssl s_client -connect <instance_name>.service-now.com:<port> -servername <instance_name>.service-now.com

* Change the service-now.com domain if your instance uses a different domain name.
* Complete the test using ports from each of the three port ranges. For example: test 4000-4003, 4100-4103, and 4200-4203.

{#producing-consuming-hermes__ul_ibq_tl1_lgc}

If the command fails internally but succeeds from a client outside the network, consult your network administrator to gain access through the network firewall.

## Bootstrap addresses {#producing-consuming-hermes__section_dsk_1db_1zb}

Use the following port mappings to connect producers and consumers to the Kafka cluster bootstrap addresses. All Application Delivery Controllers used by Hermes follow this same convention.  
Important:  
The following Hermes bootstrap address examples use ports 4000-4003, 4100-4103, and 4200-4203. However, you must open the following port ranges to ensure connectivity as additional clusters are added to the Hermes Messaging Service.

* Producer: 4000-4050
* Consumer1: 4100-4150
* Consumer2: 4200-4250
{#producing-consuming-hermes__ul_bhq_1cb_1zb}

Producer clients use ports ranging from 4000 to 4050. For example:

    Producers = "<instance_name>.service-now.com:4000,<instance_name>.service-now.com:4001,<instance_name>.service-now.com:4002,<instance_name>.service-now.com:4003"

Because Hermes uses a pair of Kafka clusters, you must configure two consumer clients with separate consumer bootstrap addresses.  
Important:  
You must configure two distinct consumer bootstrap addresses, one for each consumer client.  
* The first consumer client uses ports ranging from 4100 to 4150. For example:

      Consumer A = "<instance_name>.service-now.com:4100,<instance_name>.service-now.com:4101,<instance_name>.service-now.com:4102,<instance_name>.service-now.com:4103"

* The second consumer client uses ports ranging from 4200 to 4250. For example:

      Consumer B = "<instance_name>.service-now.com:4200,<instance_name>.service-now.com:4201,<instance_name>.service-now.com:4202,<instance_name>.service-now.com:4203"

{#producing-consuming-hermes__ul_kxl_dq3_cxb}

When you configure producer and consumer properties for your own Kafka client, use this string pattern.

## Using the command-line interface (CLI) {#producing-consuming-hermes__section_ecn_231_lgc}

When using the `list` command to view a list of topics, a list of current topics are returned from one or both clusters. Topics might be returned from only one cluster, depending on when the last synchronization
occurred. Topics created for failover purposes are differentiated by a three-letter cluster identification prefix.

When accessing the Hermes clusters using the CLI, internal topics appear in addition to any topics you've created. For details, see [KB1705399](https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1705399).

You can't delete a topic from both Kafka clusters using a single command in the command-line interface (CLI). However, you can delete the topic from both clusters by deleting the topic record in your instance. See [Delete a topic in Hermes](https://servicenow-prod.fluidtopics.net/fGhoTYGA15sPabnlcz7AYQ "Remove a topic and its messages by deleting it from Hermes. Deleting a topic record deletes it from your instance and from the Hermes Kafka cluster.").

