2 * Copyright © 2019 IBM.
3 * Modifications Copyright © 2018-2019 AT&T Intellectual Property.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 package org.onap.ccsdk.cds.blueprintsprocessor.message
20 import org.apache.kafka.streams.StreamsConfig
22 /** Producer Properties **/
23 open class MessageProducerProperties {
24 lateinit var type: String
27 open class KafkaBasicAuthMessageProducerProperties : MessageProducerProperties() {
28 lateinit var bootstrapServers: String
29 var topic: String? = null
30 var clientId: String? = null
31 // strongest producing guarantee
32 var acks: String = "all"
34 // ensure we don't push duplicates
35 var enableIdempotence: Boolean = true
38 /** Consumer Properties **/
40 open class MessageConsumerProperties {
41 lateinit var type: String
44 open class KafkaStreamsConsumerProperties : MessageConsumerProperties() {
45 lateinit var bootstrapServers: String
46 lateinit var applicationId: String
47 lateinit var topic: String
48 var autoOffsetReset: String = "latest"
49 var processingGuarantee: String = StreamsConfig.EXACTLY_ONCE
52 open class KafkaStreamsBasicAuthConsumerProperties : KafkaStreamsConsumerProperties()
54 open class KafkaMessageConsumerProperties : MessageConsumerProperties() {
55 lateinit var bootstrapServers: String
56 lateinit var groupId: String
57 lateinit var clientId: String
58 var topic: String? = null
59 var autoCommit: Boolean = true
60 var autoOffsetReset: String = "latest"
61 var pollMillSec: Long = 1000
62 var pollRecords: Int = -1
65 open class KafkaBasicAuthMessageConsumerProperties : KafkaMessageConsumerProperties()