-
Notifications
You must be signed in to change notification settings - Fork 164
Set sane default values for using the default worker #283
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
Set sane default values for using the default worker #283
Conversation
lib/kafka_ex.ex
Outdated
| {:ok, pid} = KafkaEx.Supervisor.start_link(Config.server_impl, max_restarts, max_seconds) | ||
|
|
||
| if Application.get_env(:kafka_ex, :disable_default_worker) == true do | ||
| if KafkaEx.Config.disable_default_worker do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nested modules could be aliased at the top of the invoking module.
|
Thanks for the PR! I don't see any changes that relate to the Also, I am unsure that disabling the default worker makes it easier to get started. For example, That's a pretty significant breaking change, since many people probably use the default worker as a way to get up and running quickly. I am not opposed to making a breaking change, but we definitely would need to change some documentation to reflect the requirement to start your own worker. |
f733f5c to
d34e6de
Compare
|
@efcasado Thanks for wanting to help make KafkaEx easier to use! I agree with @joshuawscott here. If the default worker is not enabled by default, then it is not really a "default worker". This was originally done with the intention of making it very easy to "try" KafkaEx with little setup. It may be worth a discussion about getting rid of the default worker completely. It was added very early on and I have always found it a little misleading, honestly. IMO the user should manage their own processes. This would be a pretty big change, though, and would definitely need a) discussion and b) a major version bump. |
|
Hey @joshuawscott, thanks for the prompt response 😄 The change to the Perhaps the description of the PR was not clear enough, my bad. It looks like I misunderstood what the default worker was all about. I thought it was a dummy worker used mostly for toying around with |
066ee59 to
ba86460
Compare
|
@dantswain Thanks for the clarification. It makes a whole lot of sense. Deprecating the default worker is definitely beyond the scope of this PR. I've just updated the PR to address only the issue with the default values, which was the sole intention of this PR 😄 . |
398dfff to
ba86460
Compare
|
👍 This looks good to me, once the merge conflict is fixed |
ba86460 to
3aaa0bb
Compare
|
I've just rebased it. |
|
Thanks again @efcasado ! |
…ults Set sane default values for using the default worker
This pull-request aims at making it easier to get started with
KafkaEx.I've noticed that some of the settings do not provide sane defaults. This pull-request introduces the following changes:
:consumer_groupoptionWithout these changes,
KafkaExyields an error at boot time.