question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compatibility betweekn kafka-junit and Kafka-streams

See original GitHub issue

I have developed a kafka-streams application and I’m using kafka-junit4 to test my application. With the SharedKafkaTestResource class I can use Kafka Consumer and Kafka Producer while my kafka streams app don’t link to the sharedKafkaTestResource.

Does sharedKafkaTestResource support KafkaStream?

What is the KafkaStream configuration to connect it to the in memory Kafka Cluster?

The following code snippet shows how I connect my kafkaStream to the SharedKafkaTestResource: ` @ClassRule public static final SharedKafkaTestResource sharedKafkaTestResource = new SharedKafkaTestResource();

final KafkaTestUtils kafkaTestUtils = getKafkaTestUtils(); kafkaTestUtils.createTopic(INPUT_TOPIC, 5, Short.valueOf(“1”)); kafkaTestUtils.createTopic(OUTPUT_TOPIC, 5, Short.valueOf(“1”));

Properties props = new Properties(); props.setProperty(StreamsConfig.APPLICATION_ID_CONFIG, “registryStreamProcessor”); props.setProperty(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, sharedKafkaTestResource.getKafkaConnectString()); RegistryKafkaStream stream = new RegistryKafkaStream(props, INPUT_TOPIC, OUTPUT_TOPIC, Consumed.with(new AdapterMessageKeySerde(), new Serdes.StringSerde())); stream.start();`

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
Crimcommented, Aug 9, 2018

I added a test case to the code base. Check it out in this PR here: https://github.com/salesforce/kafka-junit/pull/21

I think the piece you’re missing is that stream processing is asynchronous. You start the stream processor and then immediately look for results, but don’t give it any time to do the actual processing.

Let me know if this helps

0reactions
SimoneCascommented, Aug 9, 2018

Thank’s, It’s working fine!

Read more comments on GitHub >

github_iconTop Results From Across the Web

User Guide to Kafka for JUnit
Kafka for JUnit enables developers to start and stop a complete Kafka cluster comprised of Kafka brokers and distributed Kafka Connect ...
Read more >
Is kafka stream library dependent on underlying kafka broker?
Yes, this is possible. Kafka Streams is forward-compatible and backward-compatible to Kafka clusters. For example, you can also use older Kafka ...
Read more >
Testing Kafka Streams
To test a Kafka Streams application, Kafka provides a test-utils artifact that can ... It offers helper methods to compare only certain parts...
Read more >
Streams Upgrade Guide | Confluent Documentation
x, or Confluent Platform 3.2.x are not compatible with new Confluent Platform 7.3.0 Kafka Streams applications. Note. As of Confluent Platform 5.2.2 and ......
Read more >
Using Streaming with Apache Kafka - Oracle Help Center
Oracle Cloud Infrastructure Streaming lets users of Apache Kafka ... Streaming is compatible with most Kafka APIs, allowing you to use ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found