Add Kafka Streams consumer service
[ccsdk/cds.git] / ms / blueprintsprocessor / modules / commons / message-lib / src / main / kotlin / org / onap / ccsdk / cds / blueprintsprocessor / message / BluePrintMessageLibData.kt
1 /*
2  *  Copyright © 2019 IBM.
3  *  Modifications Copyright © 2018-2019 AT&T Intellectual Property.
4  *
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
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
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.
16  */
17
18 package org.onap.ccsdk.cds.blueprintsprocessor.message
19
20 import org.apache.kafka.streams.StreamsConfig
21
22 /** Producer Properties **/
23 open class MessageProducerProperties
24
25
26 open class KafkaBasicAuthMessageProducerProperties : MessageProducerProperties() {
27     lateinit var bootstrapServers: String
28     var topic: String? = null
29     var clientId: String? = null
30     // strongest producing guarantee
31     var acks: String = "all"
32     var retries: Int = 0
33     // ensure we don't push duplicates
34     var enableIdempotence: Boolean = true
35 }
36
37 /** Consumer Properties **/
38
39 open class MessageConsumerProperties
40
41 open class KafkaStreamsConsumerProperties : MessageConsumerProperties() {
42     lateinit var bootstrapServers: String
43     lateinit var applicationId: String
44     lateinit var topic: String
45     var autoOffsetReset: String = "latest"
46     var processingGuarantee: String = StreamsConfig.EXACTLY_ONCE
47 }
48
49 open class KafkaStreamsBasicAuthConsumerProperties : KafkaStreamsConsumerProperties()
50
51 open class KafkaMessageConsumerProperties : MessageConsumerProperties() {
52     lateinit var bootstrapServers: String
53     lateinit var groupId: String
54     lateinit var clientId: String
55     var topic: String? = null
56     var autoCommit: Boolean = true
57     var autoOffsetReset: String = "latest"
58     var pollMillSec: Long = 1000
59     var pollRecords: Int = -1
60 }
61
62 open class KafkaBasicAuthMessageConsumerProperties : KafkaMessageConsumerProperties()