Questions tagged [spring-kafka-test]

134 questions
16
votes
3 answers

Spring Kafka integration test Error while writing to highwatermark file

I'm writing integration test using spring-kaka-2.2.0 in spring boot application, I'm nearly succeeded still my test case return true but still I see multiple error after that. 2019-02-21 11:12:35.434 ERROR 5717 --- [ Thread-7]…
app
  • 733
  • 5
  • 15
  • 27
13
votes
7 answers

EmbeddedKafka failing since Spring Boot 2.6.X : AccessDeniedException: ..\AppData\Local\Temp\spring.kafka*

e: this has been fixed through Spring Boot 2.6.5 (see https://github.com/spring-projects/spring-boot/issues/30243) Since upgrading to Spring Boot 2.6.X (in my case: 2.6.1), I have multiple projects that now have failing unit-tests on Windows that…
DRoppelt
  • 406
  • 1
  • 4
  • 14
13
votes
2 answers

How to fix error from embedded kafka that cannot find meta.properties

I am trying to do integration test for app that using kafka, kafka-streams and cassandra. But when I am trying to setUp test class, i've got 2 errors: ERROR [main] BrokerMetadataCheckpoint: Failed to read meta.properties file under dir ERROR [main]…
faceoff
  • 151
  • 3
  • 12
10
votes
0 answers

EmbeddedKafka w/ ContainerTestUtils.waitForAssignment throws: Expected 1 but got 0 partitions

We have an integration test where we use EmbeddedKafka and produce a message to a topic, our app processes that message, and the result is sent to a second topic where we consume and assert the output. In CI this works maybe 2/3 of the time, but we…
archonic
  • 375
  • 4
  • 15
10
votes
2 answers

Spring KafkaListener: How to know when it's ready

I have a simple Spring Boot application which reads from Kafka and writes to Kafka. I wrote a SpringBootTest using an EmbeddedKafka to test all that. The main problem is: Sometimes the test fails because the test sends the Kafka message too early.…
konse
  • 885
  • 1
  • 10
  • 21
9
votes
1 answer

Kafka Streams Testing : java.util.NoSuchElementException: Uninitialized topic: "output_topic_name"

I've written a test class for kafka stream application as per https://kafka.apache.org/24/documentation/streams/developer-guide/testing.html , the code for which is import com.EventSerde; import org.apache.kafka.common.serialization.Serde; import…
6
votes
3 answers

Spring Kafka Test - Not receiving data in @KafkaListener with EmbeddedKafka

We are doing some integration test for out application using Cucumber and we are having some issues testing a @KafkaListener. We managed to use an EmbeddedKafka and produce data into it. But the consumer never receives any data and we don't know…
6
votes
1 answer

Spring kafka error Caused by: java.lang.ClassNotFoundException: org.springframework.kafka.transaction.KafkaAwareTransactionManager

This is wired just started spring boot project with simple main class, it works fine without spring-kafka dependency but after adding spring-kafka and spring-kafka-test blows up with exception, github here gradle.build apply plugin:…
Ryuzaki L
  • 37,302
  • 12
  • 68
  • 98
5
votes
1 answer

Embedded Kafka integration test - consumer never completes

I'm writing a Kafka integration test for a simple Spring Boot application. The application simple publishes to a Kafka topic. I am using an Embedded Kafka instance for the test. The test works perfectly fine when run through Intellij but fails when…
5
votes
2 answers

SpringBoot Embedded Kafka to produce Event using Avro Schema

I have created the below test class to produce an event using AvroSerializer. @SpringBootTest @EmbeddedKafka(partitions = 1, brokerProperties = { "listeners=PLAINTEXT://localhost:9092", "port=9092" }) @TestPropertySource(locations =…
5
votes
1 answer

Embedded Kafka tests randomly failing

I implemented a bunch of integration tests using EmbededKafka to test one of our Kafka streams application running using spring-kafka framework. The stream application is reading a message from a Kafka topic, it stores it into an internal state…
Julian
  • 3,678
  • 7
  • 40
  • 72
5
votes
3 answers

Wait until @KafkaListener finishes processing message in tests with @EmbeddedKafka

I have a @KafkaListener consumer and want to write integration test. The fact is that it seems to be difficult to find the exact moment when method Consumer#consume finished its execution to perform some asserts after message was processed and some…
Nipel-Crumple
  • 89
  • 3
  • 6
5
votes
3 answers

Facing issue in Connecting Kafka 3.0 - org.apache.kafka.common.KafkaException: Failed to load SSL keystore

I am trying to connect to Kafka 3.0 with SSL but facing issue with loading SSL keystore I have tried many possible values, but no help I have tried changing the locations, changing the value of the location, but still that didnt help package…
4
votes
1 answer

@EmbeddedKafka trying to register AppInfo mbean multiple times?

I have multiple integration tests using @EmbeddedKafka, and after moving to newer springboot version 2.1.8.RELEASE, the logs fills with these stacktraces. Any idea what could cause that? javax.management.InstanceAlreadyExistsException:…
Martin Mucha
  • 2,385
  • 1
  • 29
  • 49
4
votes
2 answers

How to test Kafka Streams applications with Spring Kafka?

I am writing a streaming application with Kafka Streams, Spring-Kafka and Spring Boot. I cannot find any information how to properly test stream processing done by Kafka Streams DSL while using Spring-Kafka. Documentation mentions…
1
2 3
8 9