Skip to content

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

Open
charlieLin101274 wants to merge 1 commit intogo-micro:mainfrom
charlieLin101274:fix/async-producer-options
Open

refactor(broker): AsyncProducer function to apply options directly within the returned function#147
charlieLin101274 wants to merge 1 commit intogo-micro:mainfrom
charlieLin101274:fix/async-producer-options

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