All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.quandoo.lib.reactivekafka.KafkaProperties.kt Maven / Gradle / Ivy

Go to download

A high level kafka consumer which wrapps the low level api of Kafka Reactor and provides a similar usability like Spring Kafka

There is a newer version: 1.5.1
Show newest version
/**
 *    Copyright (C) 2019 Quandoo GmbH ([email protected])
 *
 *       Licensed under the Apache License, Version 2.0 (the "License");
 *       you may not use this file except in compliance with the License.
 *       You may obtain a copy of the License at
 *
 *           http://www.apache.org/licenses/LICENSE-2.0
 *
 *       Unless required by applicable law or agreed to in writing, software
 *       distributed under the License is distributed on an "AS IS" BASIS,
 *       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *       See the License for the specific language governing permissions and
 *       limitations under the License.
 */
package com.quandoo.lib.reactivekafka

import org.springframework.boot.context.properties.ConfigurationProperties

/**
 * @author Emir Dizdarevic
 * @since 1.0.0
 */
@ConfigurationProperties(prefix = "kafka")
class KafkaProperties {

    lateinit var bootstrapServers: String

    var securityProtocol: String? = null
    var clientDnsLookup: String? = null
    var consumer: KafkaConsumerProperties? = null
    var producer: KafkaProducerProperties? = null
    var ssl: SslProperties? = null
    var sasl: SaslProperties? = null

    class KafkaConsumerProperties {
        var groupId: String? = null
        var autoOffsetReset: String = "latest"
        var parallelism = 1
        var partitionAssignmentStrategy = "org.apache.kafka.clients.consumer.RangeAssignor"
        var batchSize = 10
        var maxPoolIntervalMillis = 300000
        var batchWaitMillis = 200L
        var retryBackoffMillis = 100L
    }

    class KafkaProducerProperties {
        var maxInFlight: Int? = null
    }

    class SslProperties {
        var endpointIdentificationAlgorithm: String? = null
        var protocol: String? = null
        var enabledProtocols: String? = null
        var provider: String? = null
        var cypherSuites: String? = null
        var keystoreType: String? = null
        var keystoreLocation: String? = null
        var keystorePassword: String? = null
        var keyPassword: String? = null
        var truststoreType: String? = null
        var truststoreLocation: String? = null
        var truststorePassword: String? = null
        var keymanagerAlgorithm: String? = null
        var trustmanagerAlgorithm: String? = null
        var secureRandomImplementation: String? = null
    }

    class SaslProperties {
        var mechanism: String? = null
        var jaas: String? = null
        var clientCallbackHandlerClass: String? = null
        var loginCallbackHandlerClass: String? = null
        var loginClass: String? = null
        var kerbosServiceName: String? = null
        var kerbosKinitCmd: String? = null
        var kerbosTicketRenewWindowFactor: Double? = null
        var kerbosTicketRenewJitter: Double? = null
        var kerbosMinTimeBeforeRelogin: Long? = null
        var loginRefreshWindowFactor: Double? = null
        var loginRefreshWindowJitter: Double? = null
        var loginRefreshMinPeriodSeconds: Short? = null
        var loginRefreshBufferSeconds: Short? = null
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy