spring-kafka

Kafka Producer Thread, huge amound of threads even when no message is send

纵饮孤独 提交于 2021-02-05 12:03:50
问题 i currently profiled my kafka producer spring boot application and found many "kafka-producer-network-thread"s running (47 in total). Which would never stop running, even when no data is sending. My application looks a bit like this: var kafkaSender = KafkaSender(kafkaTemplate, applicationProperties) kafkaSender.sendToKafka(json, rs.getString("KEY")) with the KafkaSender: @Service class KafkaSender(val kafkaTemplate: KafkaTemplate<String, String>, val applicationProperties:

How do I implement in memory or embedded kafka not for testing purposes? [closed]

家住魔仙堡 提交于 2021-02-05 11:10:33
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 months ago . Improve this question I am looking to deploy a spring boot app in an environment that only allows Kafka to be run by the aforementioned app. My app will be a Kafka producer and consumer. Is there a way to run an in memory instance on startup that can be used for purposes other than testing?

How do I implement in memory or embedded kafka not for testing purposes? [closed]

半城伤御伤魂 提交于 2021-02-05 11:06:08
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 months ago . Improve this question I am looking to deploy a spring boot app in an environment that only allows Kafka to be run by the aforementioned app. My app will be a Kafka producer and consumer. Is there a way to run an in memory instance on startup that can be used for purposes other than testing?

How do I implement in memory or embedded kafka not for testing purposes? [closed]

隐身守侯 提交于 2021-02-05 11:05:40
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 months ago . Improve this question I am looking to deploy a spring boot app in an environment that only allows Kafka to be run by the aforementioned app. My app will be a Kafka producer and consumer. Is there a way to run an in memory instance on startup that can be used for purposes other than testing?

How to reset the retry count in Spring Kafka consumer when the exception thrown in the first retry is different from the second retry?

懵懂的女人 提交于 2021-01-29 22:34:48
问题 I am trying to implement a Kafka retry consumer in spring-boot and using SeekToCurrentErrorHandler for the retries. I have set the backoff policy to have 5 retry attempts. My question is, lets say the first attempt of the retry, the exception was 'database not available', and the second attempt db was available but there is another failure at another step like a timeout, in this case will the retry count goes back to zero and starts a fresh or will continue to try only of the remaining

Wait for List of ListenAbleFuture returned by Kafka Send API

感情迁移 提交于 2021-01-29 21:56:01
问题 I have the List of ListenAbleFuture.I want to wait of this List of ListenableFuture<SendResult<Integer, String>> for atmost 15 minutes if they have not comepleted. How can i achieve it. Currently i am doing this but this wait for 15 min for every ListenAbleFuture which is what i dont want. for (ListenableFuture<SendResult<Integer, String>> m : myFutureList) { m.get(15, TimeUnit.MINUTES) ; } ListenableFuture<SendResult<Integer, String>> is from import org.springframework.util.concurrent

Spring Kafka Consumer, rewind consumer offset to go back 'n' records

守給你的承諾、 提交于 2021-01-29 20:37:25
问题 I'm using "programmatic" way of consuming messages from Kafka topic using org.springframework.kafka.listener.ConcurrentMessageListenerContainer I'm wondering if there's a "spring" way of rewinding offsets for a specific partitions of a topic to go back 'n' messages? Would like to know the cleanest way of doing this (programmatically and not using the CLI). 回答1: If you want to reset the offsets during application startup, use a ConsumerAwareRebalanceListener and perform the seeks on the

What is the delay time between each poll

不羁的心 提交于 2021-01-29 16:06:25
问题 In kafka documentation i'm trying to understand this property max.poll.interval.ms The maximum delay between invocations of poll() when using consumer group management. This places an upper bound on the amount of time that the consumer can be idle before fetching more records. If poll() is not called before expiration of this timeout, then the consumer is considered failed and the group will rebalance in order to reassign the partitions to another member. This mean each poll will happen

Handle multiple responses with ReplyingKafkaTemplate

Deadly 提交于 2021-01-29 13:00:27
问题 I'm trying to implement a reply response pattern in which I publish a message to a topic listened to by several consumer groups. That means that they will all get the message as well as submit the response in the reply topic. The problem is because they all respond to the same message, only the first received message in the reply topic shall be answered. The others will be discarded. Given that I know how many responses I should be getting on the reply topic(call that number-n), how can I

Jar file not able to find the keystore

时光怂恿深爱的人放手 提交于 2021-01-29 12:49:37
问题 I am running a SpringKafka producer.I have configured the keystore location in the yml file and its being picked up when ran in eclipse. But when the code is run as a jar its unable to find the keystore location.How to resolve this. spring: kafka: producer: ssl: key-password: key-store-location: classpath:es-cert.jks key-store-password: password key-store-type: jks This is my yml file. I am getting the following error: java.io.FileNotFoundException: class path resource [es-cert.jks] cannot be