Updated on 2023-05-17 GMT+08:00

KafkaConfig

Path

com.roma.apic.livedata.config.v1.KafkaConfig

extends

java.util.Properties

Description

This class is used together with KafkaProducer or KafkaConsumer to configure a Kafka client.

Constructor Details

public KafkaConfig()

Constructs a KafkaConfig without parameters.

Method List

Returned Type

Method and Description

static KafkaConfig

getConfig(String servers, String groupId)

Obtain a configuration for accessing Kafka provided by MQS (sasl_ssl disabled).

static KafkaConfig

getSaslConfig(String servers, String groupId, String username, String password)

Obtain a configuration for accessing Kafka provided by MQS (sasl_ssl enabled).

Method Details

  • public static KafkaConfig getConfig(String servers, String groupId)

    Access Kafka (sasl_ssl not enabled) provided by MQS.

    Input Parameter

    • servers indicates the bootstrap server information in kafkaConfig.
    • groupId indicates the group ID in kafkaConfig.

    Returns

    KafkaConfig object.

  • public static KafkaConfig getSaslConfig(String servers, String groupId, String username, String password)

    Access Kafka (sasl_ssl enabled) provided by MQS.

    Input Parameter

    • servers indicates the bootstrap server information in kafkaConfig.
    • groupId indicates the group ID in kafkaConfig.
    • username indicates the username.
    • password indicates the password.

    Returns

    KafkaConfig object.