Class KafkaClientOptions


  • public class KafkaClientOptions
    extends Object
    Generic KafkaClient options.
    • Field Detail

      • DEFAULT_TRACE_PEER_ADDRESS

        public static final String DEFAULT_TRACE_PEER_ADDRESS
        Default peer address to set in traces tags is null, and will automatically pick up bootstrap server from config
      • DEFAULT_TRACING_POLICY

        public static final TracingPolicy DEFAULT_TRACING_POLICY
        Default tracing policy is 'propagate'
    • Constructor Detail

      • KafkaClientOptions

        public KafkaClientOptions()
      • KafkaClientOptions

        public KafkaClientOptions​(JsonObject json)
    • Method Detail

      • fromMap

        public static KafkaClientOptions fromMap​(Map<String,​Object> config,
                                                 boolean isProducer)
        Create KafkaClientOptions from underlying Kafka config as map
        Parameters:
        config - config map to be passed down to underlying Kafka client
        Returns:
        an instance of KafkaClientOptions
      • fromProperties

        public static KafkaClientOptions fromProperties​(Properties config,
                                                        boolean isProducer)
        Create KafkaClientOptions from underlying Kafka config as Properties
        Parameters:
        config - config properties to be passed down to underlying Kafka client
        Returns:
        an instance of KafkaClientOptions
      • getConfig

        public Map<String,​Object> getConfig()
        Returns:
        the kafka config
      • setConfig

        public KafkaClientOptions setConfig​(Map<String,​Object> config)
        Set the Kafka config.
        Parameters:
        config - the config
        Returns:
        a reference to this, so the API can be used fluently
      • setConfig

        public KafkaClientOptions setConfig​(String key,
                                            Object value)
        Set a Kafka config entry.
        Parameters:
        key - the config key
        value - the config value
        Returns:
        a reference to this, so the API can be used fluently
      • getTracingPolicy

        public TracingPolicy getTracingPolicy()
        Returns:
        the kafka tracing policy
      • setTracingPolicy

        public KafkaClientOptions setTracingPolicy​(TracingPolicy tracingPolicy)
        Set the Kafka tracing policy.
        Parameters:
        tracingPolicy - the tracing policy
        Returns:
        a reference to this, so the API can be used fluently
      • getTracePeerAddress

        public String getTracePeerAddress()
        Returns:
        the Kafka "peer address" to show in trace tags
      • setTracePeerAddress

        public KafkaClientOptions setTracePeerAddress​(String tracePeerAddress)
        Set the Kafka address to show in trace tags. Or leave it unset to automatically pick up bootstrap server from config instead.
        Parameters:
        tracePeerAddress - the Kafka "peer address" to show in trace tags
        Returns:
        a reference to this, so the API can be used fluently