apache / rocketmq-client-go

Apache RocketMQ go client
https://rocketmq.apache.org/
Apache License 2.0
1.31k stars 423 forks source link

[ISSUE #916] Modify producer api to increase flexibility #917

Open horoc opened 2 years ago

horoc commented 2 years ago

What is the purpose of the change

916

image

RequestAsync has an argument callback which is an internal function type.

Maybes it's better to define an API function without importing an internal definition.

For example:

  1. When I tried to implement a mock producer to do unit testing of my business logic, it was almost impossible.
  2. When I tried to implement a wrapper producer which integrated some custom logic, it was also very hard to do.

Brief changelog

change callback type to raw function definition.