How do I use EmbeddedSingleNodeKafkaCluster?

1,750 views
Skip to first unread message

Dean Morin

unread,
Feb 6, 2017, 2:07:16 PM2/6/17
to Confluent Platform
There is a class, "EmbeddedSingleNodeKafkaCluster" that looks like it would be really useful for tests. How can I include this in my project?

It's mentioned here:
http://docs.confluent.io/3.1.1/streams/developer-guide.html#application-examples-for-kafka-streams-provided-by-confluent

And referred to here:

These are my dependencies:
  <dependency>
    <groupId>org.apache.kafka</groupId>
    <artifactId>kafka-streams</artifactId>
    <version>0.10.1.1-cp1</version>
  </dependency>
  <dependency>
    <groupId>org.apache.kafka</groupId>
    <artifactId>kafka-clients</artifactId>
    <version>0.10.1.1-cp1</version>
  </dependency>

Matthias J. Sax

unread,
Feb 8, 2017, 1:01:34 PM2/8/17
to confluent...@googlegroups.com
We do not publish a test maven artifact atm. You will need to c&p for
now to use it. :(


-Matthias
> --
> You received this message because you are subscribed to the Google
> Groups "Confluent Platform" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to confluent-platf...@googlegroups.com
> <mailto:confluent-platf...@googlegroups.com>.
> To post to this group, send email to confluent...@googlegroups.com
> <mailto:confluent...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/confluent-platform/c1548e6a-70c7-446c-bd06-a8d37deb67dd%40googlegroups.com
> <https://groups.google.com/d/msgid/confluent-platform/c1548e6a-70c7-446c-bd06-a8d37deb67dd%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

signature.asc

Dean Morin

unread,
Feb 10, 2017, 8:46:09 PM2/10/17
to Confluent Platform

I went with the copy & paste method which Matthias mentioned. It was a little tricky, so I’ll leave my findings here in case it’s useful to someone else.

There were 3 files I had to add to my project which can be found in these two packages:

Then I found the pom.xml here:

I added dependencies one-by-one until I had just the ones I need. Originally I tried using code from the master branch, but that branch has -SNAPSHOT dependencies which are not publicly available. Switching to the latest release branch "3.1.x" worked.

These are the dependencies I needed:

  :profiles {:dev {:dependencies [[io.confluent/kafka-schema-registry "3.1.2"]
                                  [io.confluent/kafka-schema-registry "3.1.2" :classifier "tests"]
                                  [junit/junit "4.12"]
                                  [org.apache.curator/curator-test "2.9.0"]
                                  [org.apache.kafka/kafka_2.11 "0.10.1.1-cp1"]
                                  [org.apache.kafka/kafka_2.11 "0.10.1.1-cp1" :classifier "test"]
                                  [org.apache.kafka/kafka-clients "0.10.1.1-cp1" :classifier "test"]]

I’m using lein instead of maven, but these dependencies are exactly the same, just with slightly different syntax.

Shannon Ma

unread,
Feb 13, 2017, 10:10:10 AM2/13/17
to Confluent Platform
This and some util classes in the example are useful, any plan to add them to the confluent package?

Matthias J. Sax

unread,
Feb 13, 2017, 12:56:48 PM2/13/17
to confluent...@googlegroups.com
We got this request multiple times already and yes, there are plans to
publish those classes. But there is no timeline yet...

-Matthias
> > an email to confluent-platf...@googlegroups.com
> <javascript:>
> > <mailto:confluent-platf...@googlegroups.com
> <javascript:>>.
> > To post to this group, send email to confluent...@googlegroups.com
> <javascript:>
> > <mailto:confluent...@googlegroups.com <javascript:>>.
> <https://groups.google.com/d/msgid/confluent-platform/c1548e6a-70c7-446c-bd06-a8d37deb67dd%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Confluent Platform" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to confluent-platf...@googlegroups.com
> <mailto:confluent-platf...@googlegroups.com>.
> To post to this group, send email to confluent...@googlegroups.com
> <mailto:confluent...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/confluent-platform/3ac8f454-dadc-4166-9d01-92852f5ea87d%40googlegroups.com
> <https://groups.google.com/d/msgid/confluent-platform/3ac8f454-dadc-4166-9d01-92852f5ea87d%40googlegroups.com?utm_medium=email&utm_source=footer>.
signature.asc

Ryan Worsley

unread,
Jul 10, 2017, 4:24:40 PM7/10/17
to Confluent Platform
I'd like to +1 this - would speed up development a lot.

>     > an email to confluent-platform+unsub...@googlegroups.com
>     <javascript:>
>     > <mailto:confluent-platform+unsub...@googlegroups.com
>     <javascript:>>.
>     > To post to this group, send email to confluent...@googlegroups.com
>     <javascript:>
>     > <mailto:confluent...@googlegroups.com <javascript:>>.
>     > To view this discussion on the web visit
>     >
>     https://groups.google.com/d/msgid/confluent-platform/c1548e6a-70c7-446c-bd06-a8d37deb67dd%40googlegroups.com
>     <https://groups.google.com/d/msgid/confluent-platform/c1548e6a-70c7-446c-bd06-a8d37deb67dd%40googlegroups.com>
>
>     >
>     <https://groups.google.com/d/msgid/confluent-platform/c1548e6a-70c7-446c-bd06-a8d37deb67dd%40googlegroups.com?utm_medium=email&utm_source=footer
>     <https://groups.google.com/d/msgid/confluent-platform/c1548e6a-70c7-446c-bd06-a8d37deb67dd%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>     > For more options, visit https://groups.google.com/d/optout
>     <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Confluent Platform" group.
> To unsubscribe from this group and stop receiving emails from it, send

Dave Thomas

unread,
Nov 10, 2017, 10:44:09 AM11/10/17
to Confluent Platform
+1 from me too.  I see this is in the new kafka-streams-examples in the new repo repo on github : confluentinc/kafka-streams-examples.git - would be quite handy to have it as a testing-scope jar.

ryan....@zefr.com

unread,
Apr 23, 2018, 3:50:28 PM4/23/18
to Confluent Platform
Another +1 from us. 

It's been over a year and making a test artifact at this point should not be that big of a deal

Sacha Barber

unread,
Jul 12, 2018, 1:48:56 AM7/12/18
to Confluent Platform
I'd also like to add +1 to this request, it would really help trying stuff out, ok there is this

Reply all
Reply to author
Forward
0 new messages