Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
more config
Browse files Browse the repository at this point in the history
  • Loading branch information
Magnus Evensberget committed Jun 2, 2021
1 parent fc7c3bf commit 3b095dc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nais-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
timeout: 10
replicas:
min: 1
max: 2
max: 1
cpuThreasholdPercentage: 50
resources:
limits:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ abstract class KafkaConsumerWrapper<K, V>(

consumer.use {
while (!shutdown) {
val records = consumer.poll(Duration.ofMillis(100))
val records = consumer.poll(Duration.ofMillis(5000))

logger.info("Getting records from $topics. size: ${records.count()}")

records.iterator().forEach {
handle(it.value())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class KafkaProducerWrapper<K, V>(
private val producer: KafkaProducer<K, V> = KafkaProducer(properties)

fun send(key: K, event: V, callback: KafkaCallback?) {
log.info("[$topic]: $key: $event")

ProducerRecord(topic, key, event).let {
producer.send((it)) { _, exception ->
if (exception == null) {
Expand Down

0 comments on commit 3b095dc

Please sign in to comment.