Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for new Producer/Consumer without Zookeeper connection #37

Closed
barrycommins opened this issue Sep 12, 2016 · 17 comments
Closed

Support for new Producer/Consumer without Zookeeper connection #37

barrycommins opened this issue Sep 12, 2016 · 17 comments

Comments

@barrycommins
Copy link
Contributor

Hi,

is there any plan to support using the new Consumer / new Producer configuration without having to specify the connection to Zookeeper? http://kafka.apache.org/documentation.html#producerconfigs

It looks like it will default to localhost in KafkaBinderConfigurationProperties, and is an expected setting.

In some Kafka configurations, particularly when using ACLs, the connection to Zookeeper will be firewalled and the producer/consumer will only be allowed to connect to Kafka. This is often the case when management of topics is restricted.

@nitantbhartia
Copy link

@barrycommins did you find a way around this? I am seeing the same issue and was wondering if you found a workaround

@nitantbhartia
Copy link

@mbogoevici can we get some love here? Is there any way currently to bypass using zookeeper?

@barrycommins
Copy link
Contributor Author

barrycommins commented Oct 28, 2016

@nitantbhartia Hi, I've only gotten back to looking at this today, and it looks like there's a very simple solution.

just set spring.cloud.stream.kafka.binder.auto-create-topics=false and the binder will never attempt to connect to Zookeeper. It still sets the default to localhost, but it isn't used.

I've tried this on 1.1.0.RELEASE

@mbogoevici
Copy link
Contributor

@barrycommins Thanks for checking and responding! I suppose we can close this issue now?

@barrycommins
Copy link
Contributor Author

@mbogoevici Sure, I'll close it now, thanks.

@barrycommins
Copy link
Contributor Author

barrycommins commented Oct 28, 2016

One thing that might be worth noting though is that even if spring.cloud.stream.kafka.binder.auto-create-topics is set to false, the KafkaProducer / KafkaConsumer will still autocreate the topic on the initial connection, using the default properties on the Kafka broker.

This is default behaviour in Kafka unless auto.create.topics.enable is set to false in server.properties.
It will just be done by Kafka code instead of explicitly by the Spring Cloud Stream Kafka binder

@mbogoevici
Copy link
Contributor

Yes - this is documented in the setting description (see http://docs.spring.io/spring-cloud-stream/docs/Brooklyn.BUILD-SNAPSHOT/reference/htmlsingle/#_configuration_options_2) . That is the behaviour of the Kafka broker and there's nothing that can be do on our side to control it - so the only thing we can do is to document it.

@barrycommins
Copy link
Contributor Author

Oops, RTFM I guess :-)
Sorry about that.

@mbogoevici
Copy link
Contributor

No worries! Thanks for staying in touch! Looking forward to more :)!

@jensdt
Copy link

jensdt commented Jan 2, 2017

Just a heads up if you, like me, came upon this issue and still have problems... @barrycommins made a small typo in the property - 'kakfa.binder' should of course be 'kafka.binder'.

Serves me right for blindly copy-pasting but hopefully this saves somebody else the 15 minutes I spent wondering why this didn't work.

@barrycommins
Copy link
Contributor Author

@jensdt Sorry about that, I'd say I'd type 'kakfa' instead of 'kafka' about 50% of the time!

I've updated the original comment now to correct it.

@daggerok
Copy link

Thanks for spring.cloud.stream.kafka.binder.auto-create-topics=false good to know!

@garyrussell
Copy link
Contributor

Just to close this out; the upcoming 2.0 release has no dependencies on zookeeper at all. Even though the bindings have used the pure java client for a long time now, we still needed to go via Zookeeper to provision topics.

There is now a pure Java AdminClient (it was added in 0.11 but was not fully functional - for the binder's needs - until 1.0.0).

@vbasem
Copy link

vbasem commented Feb 11, 2018

@garyrussell is this part of any of the current milestones? As of M5 I am still seeing zookeeper connections being opened.

@garyrussell
Copy link
Contributor

There is no M5; what do you mean?

2.0.0.M4 was released last week and no longer has zookeeper dependencies.

This commit: 50b8955

As you can see from the tag it is in M4

screen shot 2018-02-11 at 11 12 56 am

@vbasem
Copy link

vbasem commented Feb 11, 2018

Sorry I was not being accurate, M5 was referring to Spring Cloud Finchley.M5 release train.
Do you think M4 will be part of the next release train?

@garyrussell
Copy link
Contributor

See the project page.

Finchley.M5 includes Elmhurst.M3; you need to override the stream dependencies to Elmhurst.M4.

Presumably it will be in the next Finchley milestone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants