• Distributed Message Service

dms
  1. Help Center
  2. Distributed Message Service
  3. Developer Guide
  4. Configuring Parameters

Configuring Parameters

Procedure

  1. (Optional) Configure a private DNS server.

    You need to use an ECS to connect to DMS Kafka. You do not need to configure a private DNS server for a newly created ECS. If an existing ECS is used, you need to configure the DNS server IP address.

    The DNS server IP address in the eu-de region is 172.16.16.65

  2. Configure access_key, secret_key, and project_id in the dms_kafka_client_jaas.conf file.

    The three parameters are used to authenticate DMS Kafka API requests.

    KafkaClient {
      com.dms.kafka.sasl.client.KafkaLoginModule required
      access_key="your ak"
      secret_key="your sk"
      project_id="projectID";
    };

    Replace them with the actual access_key, secret_key, and project_id of your account.

    To access the queues authorized by other tenants, set target_project_id to the project ID of the authorizing tenant.

  3. Configure SASL to start upon process using either of the methods. In both methods, replace /path with the actual path name.

    1. Method 1 Configure the following JVM parameter to add the location of SASL configuration file:
      -Djava.security.auth.login.config=/path/kafka_client_jaas.conf
    2. Method 2 Add the following information to project code so that SASL can start before Kafka Producer and Consumer start:
      System.setProperty("java.security.auth.login.config", "/path/kafka_client_jaas.conf");

  4. Add the following information to the consumer.properties file:

    connections.max.idle.ms=30000

  5. Configure key parameters in the consumer.properties/producer.properties file.

    Table 1 Key parameters in the consumer.properties/producer.properties file

    Parameter

    Description

    Value

    bootstrap.servers

    IP address or domain name of the DMS server

    dms-kafka.eu-de.otc.t-systems.com:37000

    ssl.truststore.location

    Path in which the client certificate client.truststore.jks is located

    /path/client.truststore.jks, where /path must be replaced with the actual path name

    ssl.truststore.password

    Client certificate password

    -

    security.protocol

    Security protocol

    SASL_SSL

    sasl.mechanism

    Service name

    DMS

    Note: All letters in the entered service name must be capitalized.

    For details about other Kafka parameters, visit the official Kafka website.

  6. Enable Kafka debug logging by modifying the log4j.properties file.

    log4j.rootLogger=DEBUG, stdout 
    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c:%L)%n
    log4j.logger.org.apache.kafka.clients=DEBUG
    log4j.logger.kafka=INFO, stdout
    log4j.additivity.kafka=false
    log4j.logger.org.apache.kafka=DEBUG, stdout
    log4j.additivity.org.apache.kafka=false

  7. Write code. For details about APIs, visit the official Kafka website.