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

ConsumerGroup.Manager does not proxy along worker options #407

Closed
zapient opened this issue May 1, 2020 · 5 comments
Closed

ConsumerGroup.Manager does not proxy along worker options #407

zapient opened this issue May 1, 2020 · 5 comments

Comments

@zapient
Copy link
Contributor

zapient commented May 1, 2020

We are trying to configure our producers and consumer groups with individual cluster configurations but we noticed that in our review environments that use SSL we were unable to connect.

Supervisor.Spec.supervisor(
  KafkaEx.ConsumerGroup,
  [
    OurSweetConsumer,
    "my-topic",
    ["my-consumer-group-name"],
    [uris: [{"ec2-xxx.compute-1.amazonaws.com", 9096}], use_ssl: true, ssl_options: [cert: <<...>>, key: { :RSAPrivateKey, <<..>>}]]
  ]
)

This is because ConsumerGroup.Manager is dropping all but the uris option.
I'm curious if this was by design and that I am totally missing the reasoning behind it.

Note the same issue is on GenConsumer

@joshuawscott
Copy link
Member

joshuawscott commented May 3, 2020

I don't know if this was an intentional decision, but you can handle this by creating your own worker(s) and passing it into the fetch_options: of a consumer group.
So,

{:ok, _} = KafkaEx.create_worker(MyWorker, uris: [{"ec2-xxx.compute-1.amazonaws.com", 9096}], use_ssl: true, ssl_options: [cert: <<...>>, key: { :RSAPrivateKey, <<..>>}])
Supervisor.Spec.supervisor(
  KafkaEx.ConsumerGroup,
  [
    OurSweetConsumer,
    "my-topic",
    ["my-consumer-group-name"],
    [fetch_options: [worker_name: MyWorker]]
  ]
)

Edit:
I think we'd be open to something to make this easier, although I would suggest the easiest way to handle this might be to allow passing in a worker and ensuring it uses that worker for all communication.

@zapient
Copy link
Contributor Author

zapient commented May 5, 2020

Any objections to a simple addition to include ssl and ssl_options to the proxied worker_opts?

@markusfeyh
Copy link
Contributor

To close the loop here, added a PR to add this here: #413

It ends up requiring less verbosity and allows for passing through options to the worker @joshuawscott

@markusfeyh
Copy link
Contributor

This can be closed now that the PR has been merged in

@joshuawscott
Copy link
Member

Thanks!

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