Questions tagged [embedded-kafka]

75 questions
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
7
votes
0 answers

ZooKeeper session expired in tests

I'm using the EmbeddedKafka for testing my module with the following annotation confiugration: @ExtendWith(SpringExtension.class) @SpringBootTest @TestPropertySource(locations = "classpath:test.properties") @EmbeddedKafka(partitions = 1, topics…
5
votes
3 answers

Embedded Kafka Spring test executes before embedded Kafka is ready

I have a Spring Boot project that has a Kafka listener that I want to test using Embedded Kafka. I have the Kafka Listener log out the message "record received". Which will only be be logged out if I add a Thread.sleep(1000) to the start of the…
5
votes
1 answer

What value to provide for the Kafka schema.registry.ssl.engine.factory.class

I have a spring boot application with some kafka providers/consumers and some integration tests(using embedded kafka) for them. Everything worked fine, until i have lifted the spring boot version to 2.3(from 2.1.x) and the spring-kafka to 2.6.0. Now…
5
votes
1 answer

Spring Embedded Kafka + Mock Schema Registry: State Store ChangeLog Schema not registered

I'm building an integration test for our kafka system using the Spring Embedded Kafka Broker, with a MockSchemaRegistryClient. I am building a test for one of our Stream topologies, built using the Streams API (KStreamBuilder). This particular…
4
votes
1 answer

Failed to create or validate data directory for EmbeddedKafkaBroker

I am trying to run a simple unit test using @EmbeddedKafka Annotation. As a reference, I am following the below spring documentation…
DALDOUL
  • 154
  • 1
  • 10
3
votes
1 answer

How to read from embedded-kafka with fs2-kafka

I am using fs2-kafka to read from embedded-kafka. I create the embedded kafka using withRunningKafkaOnFoundPort, create topic and publish a few messages. However when I try to read it back with fs2-kafka I get a NullPointerException. I have isolated…
Lev Denisov
  • 2,011
  • 16
  • 26
3
votes
2 answers

EmbeddedKafkaRule - Getting "java.net.BindException: Can't assign requested address" exception

I am using EmbeddedKafkaRule as below in a SpringBootTest class- private static final String TEMPLATE_TOPIC = "templateTopic"; @ClassRule public static EmbeddedKafkaRule embeddedKafka = new EmbeddedKafkaRule(1, true, TEMPLATE_TOPIC); …
hsandhu
  • 31
  • 2
3
votes
1 answer

How to stop and start the Embedded Kafka in unit test?

I use Embedded Kafka to test send message to Kafka, when send failed, my code will re-send automatically, so I try to stop the Embedded Kafka then restart it during re-sending. But I don't know how to stop and start the Embedded Kafka.
Daniel
  • 31
  • 1
  • 2
3
votes
2 answers

Embedded kafka not able to start - Error

I am having a hard time to fix this issue. Here is my Junit and i am using spring embedded kafka. When i run my test case i am getting weird issue/exception. @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment =…
Sthita
  • 1,750
  • 2
  • 19
  • 38
2
votes
1 answer

Using embedded Kafka in spring cloud stream test with custom channel bindings

I have a spring boot application where I am using spring-cloud-stream to consume from a kafka topic, do some processing and publish to another kafka topic. The application works fine and I've written unit tests (using the TestBinder) which are…
Samba Mitra
  • 35
  • 1
  • 4
2
votes
0 answers

Embedded Kafka Appender not working with Log4j2 xml

I want write unit test for Kafka Appender using log4j2 xml. I am using embedded kafka but it is not able to initialize ${spring.embedded.kafka.brokers} this property. I get this error java.lang.ExceptionInInitializerError at…
2
votes
0 answers

Testing with EmbeddedKafka - Test report

I'm using EmbeddedKafka to test the integration with Kafka in my microservice. And also, I'm using jacoco for publishing the test result. Inorder to make the test run without any issue, I have to make the forkCount parameter as 0. …
Thiru
  • 2,541
  • 4
  • 25
  • 39
2
votes
0 answers

Embedded Kafka tests (ran by SBT) intermittently fails with ZooKeeperServer errors

I'm writing a group of tests using the spring KafkaEmbedded test util. The tests each individually stand up an embedded kafka instance, produce events and assert the resultant downstream events. The tests consistently pass when run in an IDE (e.g.…
2
votes
1 answer

Spark - Is not stopping Spark Stream that consumes a Kafka topic

I'm trying to write a test for spark streaming example that consumes data from kafka. I'm using EmbeddedKafka for this. implicit val config = EmbeddedKafkaConfig(kafkaPort = 12345) EmbeddedKafka.start() …
tharindu_DG
  • 8,900
  • 6
  • 52
  • 64
1
2 3 4 5