You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "John Roesler (Jira)" <ji...@apache.org> on 2020/05/14 15:14:00 UTC
[jira] [Commented] (KAFKA-9992) EmbeddedKafkaCluster not working
with kafka_2.13
[ https://issues.apache.org/jira/browse/KAFKA-9992?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17107394#comment-17107394 ]
John Roesler commented on KAFKA-9992:
-------------------------------------
Hello Andras,
Just to make sure I understand, is this just a problem with our test artifact? The test artifacts are not public APIs, and I would not recommend depending on them.
If you want to submit a PR for your patch we can merge it, but I don’t think we can call this a bug.
Note that there have been a few conversations in Jira and on the mailing list about actually creating a public EmbeddedKafkaCluster for testing. So far, no one has picked it up, though. If you’re interested in doing that, it would be appreciated, and I can help with the KIP process.
My standard advice is to copy/paste the EmbeddedKafkaCluster into your own test module so that you don’t depend on upstream tests.
> EmbeddedKafkaCluster not working with kafka_2.13
> ------------------------------------------------
>
> Key: KAFKA-9992
> URL: https://issues.apache.org/jira/browse/KAFKA-9992
> Project: Kafka
> Issue Type: Bug
> Components: packaging, streams
> Affects Versions: 2.4.1
> Reporter: Andras Katona
> Priority: Major
>
> Kafka Streams artifact is depending on kafka_2.12 as of now, it is in the [kafka-streams-2.4.1.pom|https://repo1.maven.org/maven2/org/apache/kafka/kafka-streams/2.4.1/kafka-streams-2.4.1.pom]:
> {code}
> <dependency>
> <groupId>org.apache.kafka</groupId>
> <artifactId>kafka_2.12</artifactId>
> <version>2.4.1</version>
> <scope>test</scope>
> </dependency>
> {code}
> But it is not hardcoded, whatever scala version was used to compile this component before uploading, that will be present in the pom.
> When I'm using these deps:
> {code}
> <dependency>
> <groupId>org.apache.kafka</groupId>
> <artifactId>kafka-streams</artifactId>
> <version>2.4.1</version>
> <classifier>test</classifier>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.apache.kafka</groupId>
> <artifactId>kafka_2.13</artifactId>
> <version>2.4.1</version>
> <classifier>test</classifier>
> <scope>test</scope>
> </dependency>
> {code}
> My test fails with the following exception (deleteTopicAndWait is called in my @After method):
> {noformat}
> java.lang.NoSuchMethodError: scala.collection.JavaConverters.setAsJavaSetConverter(Lscala/collection/Set;)Lscala/collection/convert/Decorators$AsJava;
> at org.apache.kafka.streams.integration.utils.EmbeddedKafkaCluster$TopicsDeletedCondition.conditionMet(EmbeddedKafkaCluster.java:316)
> at org.apache.kafka.test.TestUtils.lambda$waitForCondition$4(TestUtils.java:370)
> at org.apache.kafka.test.TestUtils.retryOnExceptionWithTimeout(TestUtils.java:417)
> at org.apache.kafka.test.TestUtils.retryOnExceptionWithTimeout(TestUtils.java:385)
> at org.apache.kafka.test.TestUtils.waitForCondition(TestUtils.java:368)
> at org.apache.kafka.test.TestUtils.waitForCondition(TestUtils.java:356)
> at org.apache.kafka.streams.integration.utils.EmbeddedKafkaCluster.deleteTopicsAndWait(EmbeddedKafkaCluster.java:266)
> at org.apache.kafka.streams.integration.utils.EmbeddedKafkaCluster.deleteTopicAndWait(EmbeddedKafkaCluster.java:221)
> {noformat}
> I modified kafka build locally to separate artifacts based on scala version just like it is done with kafka core, and I pulled in kafka-streams_2.13 from my local mvn repo and test was working again.
> I was only trying with 2.4.1, but I'm assuming other versions are also affected, please add the proper versions and proper components too (in case it's not packaging).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)