Configuring Parameters
Procedure
- 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.huawei.middleware.kafka.sasl.client.KafkaLoginModule required access_key="XXXXXX" secret_key="XXXXXX" project_id="XXXXXX"; };
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.KafkaClient { com.huawei.middleware.kafka.sasl.client.KafkaLoginModule required access_key="XXXXXX" secret_key="XXXXXX" project_id="XXXXXX" target_project_id=""; };
- Configure SASL access to start upon process using either of the following methods. In both methods, replace /path with the actual path name.
- 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
- Method 2: Add the following information to project code so that SASL access can start before Kafka Producer and Consumer start:
System.setProperty("java.security.auth.login.config", "/path/kafka_client_jaas.conf");
- Method 1: Configure the following JVM parameter to add the location of SASL configuration file:
- Add the following information to the consumer.properties file:
connections.max.idle.ms=30000
- Configure key parameters in the consumer.properties/producer.properties file.
Table 1 Key parameters in the consumer.properties/producer.properties file Parameter
Description
Setting
bootstrap.servers
IP address or domain name of the DMS server
-
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.
- 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
- Write code. For details about APIs, visit the official Kafka website.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot