Questions tagged [spring-kafka]

The Spring for Apache Kafka (spring-kafka) project applies core Spring concepts to the development of Apache Kafka-based messaging solutions.

The Spring for Apache Kafka (spring-kafka) project applies core Spring concepts to the development of Apache Kafka-based messaging solutions. It provides a "template" as a high-level abstraction for sending messages. It also provides support for Message-driven POJOs with @KafkaListener annotations and a "listener container". These libraries promote the use of dependency injection and declarative. In all of these cases, you will see similarities to the JMS support in the Spring Framework and RabbitMQ support in Spring AMQP.

has a module spring-integration-kafka providing channel adapters and gateways based on spring-kafka.

Resources

See Also

4185 questions
9
votes
1 answer

Integrating Spring Boot and Reactor-Kafka's KafkaReceiver

I am trying to develop a Spring Boot application using the library reactor-kafka to react to some messages read from a Kafka topic. I have a configuration class that builds a KafkaReceiver. @Configuration public class MyConfiguration { @Bean …
riccardo.cardin
  • 7,971
  • 5
  • 57
  • 106
9
votes
2 answers

How to use Spring-Kafka to read AVRO message with Confluent Schema registry?

How to use Spring-Kafka to read AVRO message with Confluent Schema registry? Is there any sample? I can't find it in official reference document.
9
votes
1 answer

Kafka in Kubernetes - Marking the coordinator dead for group

I am pretty new to Kubernetes and wanted to setup Kafka and zookeeper with it. I was able to setup Apache Kafka and Zookeeper in Kubernetes using StatefulSets. I followed this and this to build my manifest file. I made 1 replica of kafka and…
Sibtain
  • 1,436
  • 21
  • 39
9
votes
1 answer

Spring Kafka KafkaTemplate.flush() required?

I am using Spring kafka for the first time and I have created a Producer and Consumer by using spring kafka. I have my kafka server running on localhost and have created a topic called test. I was not able to send messages to the consumer by simply…
Indraneel Bende
  • 3,196
  • 4
  • 24
  • 36
9
votes
2 answers

How to pass multiple bootstrap servers for listener using spring-kafka

I have a listener that need to read from multiple kafka servers with the same topic which are all configured under one zookeeper. How do I read from those multiple servers. Can you please help with this. Instead of Kafka servers, can I point to…
daemon54
  • 1,057
  • 3
  • 16
  • 36
9
votes
4 answers

spring boot kafka LocalDateTime

I have a basic POJO that contains a java.time.LocalDateTime: package foo.bar.asire.api.model; import java.time.LocalDateTime; public class Address { private Long id; private Integer houseNumber; private String address; private…
user3175414
  • 173
  • 1
  • 7
9
votes
4 answers

How to determine a Kafka consumer's offset

We have an issue where it appears that a Kafka consumer is not receiving messages published to a topic. (I say appears as I have not yet got to the bottom of this, and I could be wrong.) I am using Spring for Apache Kafka and my consumer is actually…
vegemite4me
  • 6,621
  • 5
  • 53
  • 79
9
votes
1 answer

Spring Kafka JsonSerializer usage

I am trying to follow the instructions here: http://docs.spring.io/spring-kafka/docs/1.1.1.RELEASE/reference/htmlsingle/#_serialization_deserialization_and_message_conversion To set up a KafkaTemplate that can serialize and send some simple Java…
Matt
  • 3,303
  • 5
  • 31
  • 53
8
votes
0 answers

KafkaException: jdk.internal.loader.ClassLoaders can’t find org.apache.kafka.common.security.plain.PlainLoginModule

Caused by: org.apache.kafka.common.KafkaException: javax.security.auth.login.LoginException: No LoginModule found for org.apache.kafka.common.security.plain.PlainLoginModule at…
8
votes
2 answers

How to replace deprecated SeekToCurrentErrorHandler with DefaultErrorHandler (spring-kafka)?

I am trying to find a way to use the new DefaultErrorHandler instead of deprecated SeekToCurrentErrorHandler in spring-kafka 2.8.1, in order to override the retry default behavior in case of errors. I want to "stop" the retry process, so if an error…
Mars
  • 107
  • 1
  • 1
  • 7
8
votes
2 answers

Connection to node -1 (/127.0.0.1:9092) could not be established. Broker may not be available

I am working on Spring Boot Kafka example from Confluent and running the simple producer example and getting below error. I am using Windows machine and installed ubunt 14.04 LTS on windows. Note - Even though if I used localhost, still it doesn't…
PAA
  • 1
  • 46
  • 174
  • 282
8
votes
1 answer

java.lang.ClassNotFoundException: org.apache.kafka.clients.consumer.ConsumerGroupMetadata

I am trying to create a simple Kafka producer. I followed a tutorial since I am new to this topic. I created a config file as recommended in the video. Here is the config file I am using. import…
Rohi
  • 385
  • 2
  • 3
  • 15
8
votes
2 answers

Kafka Consumer metrics gone upon upgrade from Spring Boot 2.2.2 to 2.3.0

Problem: We upgraded our Spring Boot version from 2.2.2 to 2.3.0, and all of the kafka_consumer_* metrics that were seen in the Prometheus endpoint in 2.2.2 are not visible in 2.3.0. For example, all of the below are…
8
votes
1 answer

Kafka Consumer with enable.auto.commit = false still committing the offsets

Kafka consumer has processed the messages 1, 2, 3, 4 and the enable.auto.commit is set to false. But on restarting the consumer, it is not reprocessing the above messages again, from CLI I could see that the offset has been incremented and there is…
Harsha
  • 349
  • 1
  • 8
  • 20
8
votes
2 answers

spring-kafka application.properties configuration for JAAS/SASL not working

Use Case: I am using Spring Boot 2.2.5.RELEASE and Kafka 2.4.1 JAAS/SASL configurations are done properly on Kafka/ZooKeeper as topics are created without issue with kafka-topics.bat Issue: When i start Spring Boot application, i immediately get the…
jumping_monkey
  • 5,941
  • 2
  • 43
  • 58