Using Kafka with SSL

Chris ColosimoChris Colosimo Posts: 100 admin

Parasoft SOAtest supports Kafka through the Kafka plugin available on the Parasoft Marketplace.

The Kafka transport allows you to configure SSL and other security settings with global Producer and Consumer properties through scripting. You can add an extension tool to your test suite and add the following properties

import com.parasoft.soavirt.transport.kafka.*;

void configureClientSSL() {
    // configure producer
    KafkaConsumerHelper.CONSUMER_GLOBAL_CONFIGS.put("security.protocol", "SSL");
    KafkaConsumerHelper.CONSUMER_GLOBAL_CONFIGS.put("ssl.keystore.location", "C:/SUPPORT/Kafka-SSL/keystores/server.keystore.jks");
    KafkaConsumerHelper.CONSUMER_GLOBAL_CONFIGS.put("ssl.keystore.password", "password");
    KafkaConsumerHelper.CONSUMER_GLOBAL_CONFIGS.put("ssl.key.password", "password");
    KafkaConsumerHelper.CONSUMER_GLOBAL_CONFIGS.put("ssl.truststore.location", "C:/SUPPORT/Kafka-SSL/keystores/server.truststore.jks");
    KafkaConsumerHelper.CONSUMER_GLOBAL_CONFIGS.put("ssl.truststore.password", "password");

    // configure consumer
    KafkaProducerHelper.PRODUCER_GLOBAL_CONFIGS.put("security.protocol", "SSL");
    KafkaProducerHelper.PRODUCER_GLOBAL_CONFIGS.put("ssl.keystore.location", "C:/SUPPORT/Kafka-SSL/keystores/server.keystore.jks");
    KafkaProducerHelper.PRODUCER_GLOBAL_CONFIGS.put("ssl.keystore.password", "password");
    KafkaProducerHelper.PRODUCER_GLOBAL_CONFIGS.put("ssl.key.password", "password");
    KafkaProducerHelper.PRODUCER_GLOBAL_CONFIGS.put("ssl.truststore.location", "C:/SUPPORT/Kafka-SSL/keystores/server.truststore.jks");
    KafkaProducerHelper.PRODUCER_GLOBAL_CONFIGS.put("ssl.truststore.password", "password");
Sign In or Register to comment.