Create a test topic in Hermes using the Kafka client

  • 릴리스 버전: Australia
  • 업데이트 날짜 2026년 03월 12일
  • 소요 시간: 5분
  • Create a topic for sending and receiving test messages in the Hermes Kafka cluster.

    시작하기 전에

    Role required: admin

    이 태스크 정보

    The full Hermes Kafka topic name is composed of the following elements:

    snc.<instance_name>.<namespace>.<app_id>.<topic_name>
    where:
    • <instance_name> is the name of your instance
    • <namespace> is the namespace of the domain your Kafka topic belongs to (optional)
    • <app_id> is your application ID

      The topic you create belongs to this application. Specify either of the following:

      • sn_logstoanalytics for Log Export Service topics
      • sn_streamconnect for Stream Connect topics
    • <topic_name> is the unique name for your topic
    주:
    The full topic name is case-sensitive and limited to 200 characters.

    프로시저

    1. 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
    2. Configure a producer.
      1. Open the producer.properties file.
      2. Configure the following SSL properties:
        security.protocol=SSL
        
        ssl.truststore.password=<truststore password>
        
        ssl.truststore.location=<path to truststore.p12>
        
        ssl.truststore.type=PKCS12
        
        ssl.keystore.password=<keystore password>
        
        ssl.keystore.location=<path to keystore.p12>
        
        ssl.keystore.type=PKCS12
        
        ssl.key.password=<keystore password>
        Replace the following placeholder variables:
        • <truststore password> with your truststore password
        • <path to truststore.p12> with the path to your truststore file
        • <keystore password> with your keystore password
        • <path to keystore.p12> with the path to your keystore file
      3. Save your changes in plain text.
    3. Navigate to your Kafka directory.
    4. Create a test topic by running the following command:
      • Unix:
        ./bin/kafka-topics.sh --create --topic snc.<instance_name>.<namespace>.sn_<app_id>.<topic_name> --command-config ./config/producer.properties --bootstrap-server <instance_name>.service-now.com:4000,<instance_name>.service-now.com:4001,<instance_name>.service-now.com:4002,<instance_name>.service-now.com:4003
      • Windows:
        bin\windows\kafka-topics.bat --create --topic snc.<instance_name>.<namespace>.sn_<app_id>.<topic_name> --command-config config\producer.properties --bootstrap-server <instance_name>.service-now.com:4000,<instance_name>.service-now.com:4001,<instance_name>.service-now.com:4002,<instance_name>.service-now.com:4003
      Replace the following placeholder variables:
      • <instance_name> with your instance name (case-sensitive)
      • <namespace> with the namespace of the domain your Kafka topic belongs to (optional)
      • <app_id> with the application ID (case-sensitive)
      • <topic_name> with the unique topic name you want to use (case-sensitive)

    결과

    A test topic is created in the Hermes Kafka cluster.

    다음에 수행할 작업

    Produce test messages to a Hermes topic using the Kafka client