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

refactor(broker): AsyncProducer function to apply options directly within the returned function #147

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

charlieLin101274
Copy link

Description

This PR addresses an issue where the AsyncProducer function could not be used as demonstrated in the README.md example. The original implementation of AsyncProducer returned a single option function that could only apply one of the errors or successes channels, leading to incorrect behavior when both channels were provided.

Changes

  • Refactored the AsyncProducer function to apply both the errors and successes channels directly within the returned function, ensuring that both options are correctly set on the broker.Options.
  • This update ensures that the AsyncProducer function behaves as expected when used in accordance with the example provided in the README.md.

This fix allows users to properly capture both producer errors and successes when using the AsyncProducer function, improving the reliability and correctness of the Kafka broker setup.

…thin the returned function

- Modified AsyncProducer to set `errors` and `successes` channels directly within the returned function instead of returning a separate option function.
- Ensures that both channels are properly applied to the `broker.Options` when provided.
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

Successfully merging this pull request may close these issues.

1 participant