rocketmq-client-go icon indicating copy to clipboard operation
rocketmq-client-go copied to clipboard

Modify producer api to increase flexibility

Open horoc opened this issue 3 years ago • 1 comments

FEATURE REQUEST

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.

horoc avatar Sep 09 '22 18:09 horoc

you can try this

https://github.com/apache/rocketmq-client-go/blob/49f0448ef642f9cf9294e94a637fbeed4328a3f4/examples/producer/rpc/async/main.go#L52-L59

francisoliverlee avatar Oct 31 '23 02:10 francisoliverlee