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

Doc issue: Consumer and producer examples are not correct/complete #515

Closed
davideicardi opened this issue Jun 20, 2018 · 1 comment
Closed
Milestone

Comments

@davideicardi
Copy link

I have some problems creating an "hello world" example following your documentation.

The main problem is that there isn't a concise and easy to follow end-to-end example.

The other problem is that the code provided for ConsumerSettings and ProducerSettings are not correct:

val config = system.settings.config
val consumerSettings =
  ConsumerSettings(config, new StringDeserializer, new ByteArrayDeserializer)
    .withBootstrapServers("localhost:9092")
    .withGroupId("group1")
    .withProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest")
val config = system.settings.config
val producerSettings =
  ProducerSettings(config, new StringSerializer, new StringSerializer)
    .withBootstrapServers("localhost:9092")

Because the apply function looks directly for a section kafka-clients while the system.settings.config contains this section inside akka.kafka.consumer/akka.kafka.producer.
See also this discussion.

I'm right or I'm missing something?

thanks

@ennru
Copy link
Member

ennru commented Jun 20, 2018

Thank you for reporting this.
You are totally right, you need to pass config.getConfig("akka.kafka.producer") to get the same behaviour as when passing the actor system.

@2m 2m closed this as completed in #516 Jun 20, 2018
@2m 2m added this to the 0.22 milestone Jun 20, 2018
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

3 participants