Create message and Kafka topic replications in Stream Connect
Set up message and topic replications to replicate data between your Apache Kafka environment and ServiceNow.
Before you begin
- Role required: message_replication_admin
- This feature requires a subscription. For more information, see Using Stream Connect for Apache Kafka.
- Verify the Hermes Messaging Service and Instance PKI Certificate Generator are working.
- Check the status of and connection to the Hermes Kafka cluster.
- Check the Key Management Framework Health to verify that all three items in the Instance PKI section are operational.
-
Configure and start a MID Server or MID Server cluster. For more information, see Configuring MID Servers and Configure a MID Server cluster.
The MID Server must be able to access Hermes endpoints through the firewall. Work with your network administrator to make sure that the following port ranges are open.- Producer: 4000–4050
- Consumer1: 4100–4150
- Consumer2: 4200–4250
Note:Proxy settings on the MID Server don't apply to Hermes connectivity. The MID Server proxy configuration applies only to HTTP-based communication. Hermes uses Kafka-native TCP connections, so traffic to the Hermes cluster bypasses proxy settings regardless of how the MID Server is configured.If you're using a MID Server cluster, it must have a cluster type of Load Balance. The Failover cluster type is not supported.
- Stream Connect Message Replication uses a Connection & Credential alias to connect to your local Kafka. Create a Connection & Credential alias with a Connection type of Kafka. A Connection & Credential alias requires a Kafka Connection and a Kafka SSL Credential.
- Stream Connect Message Replication requires the ServiceNow Stream Connect Installer [com.glide.hub.stream_connect.installer] plugin.
About this task
This page shows you how to create a Message Replication record and an associated Kafka Topic Replication record.
A Message Replication record represents a single Kafka cluster. For example, if you have two Kafka clusters, you would create two different message replication records, one for each cluster. A Message Replication record is the parent record for all the topics being replicated to or from that cluster. Message Replication records are stored in the Message Replications [sys_sc_message_replication] table.
A Kafka Topic Replication record specifies the replication from a single source topic to a single destination topic. You can't replicate a single source topic to multiple destinations. You can only replicate to each destination once. Kafka Topic Replication records are stored in the Kafka Topic Replications [sys_kafka_topic_replication] table.
Procedure
Result
After you've created all your message and topic replication records, messages should be replicating. You can check the Message Replication Statuses [sys_sc_message_replication_status] tab on the Message Replication form to view the status, MID Server, and error messages for each message replication.
You can also check the Channel Replication Statuses [sys_sc_channel_replication_status] tab on the Kafka Topic Replication record to view status details for each topic replication, including the MID Server, Error message, and Error Since values.
Each Kafka Topic Replication record also has a related list named Message Replication Statistics. Once replications are running, this list displays metrics records, which are created every 60 seconds for each topic replication. Each metrics record has information about the topic replication, including the Message count, which shows the number of messages replicated in each collection interval.
What to do next
If you're replicating messages from your local Kafka into ServiceNow, you can configure a Script, ETL, or Transform Map consumer to process the messages or set up a Kafka Message trigger to start a flow.
If you're replicating messages from ServiceNow to your local Kafka, you can use a Kafka Producer step in Workflow Studio or use the ProducerV2 API to publish messages to the Hermes topic and your local Kafka.