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

Talk about send interface logic #31

Closed
wolfstudy opened this issue Jul 30, 2019 · 3 comments
Closed

Talk about send interface logic #31

wolfstudy opened this issue Jul 30, 2019 · 3 comments

Comments

@wolfstudy
Copy link
Member

Is your feature request related to a problem? Please describe.

In Producer interface, Send is defined as follows:

Send(context.Context, *ProducerMessage) error

SendAsync(context.Context, *ProducerMessage, func(MessageID, *ProducerMessage, error))

In fact, when the pulsar client receives the sendReceipt, we don't assign a value to the ProducerMessage. The returned value is always nil.

Describe the solution you'd like

We can define the interface as follows:

Send(context.Context, *ProducerMessage) (MessageID, error)

SendAsync(context.Context, *ProducerMessage, func(MessageID,  error))

This way, on the one hand, it can be consistent with the Java client in the interface definition. On the other hand, we only need the msgID field. In this regard, if there is a place that is not considered comprehensive, please correct me.

@merlimat
Copy link
Contributor

👍 SGTM. It was a frequently requested feature on the C++ based Go client.

@merlimat
Copy link
Contributor

We should do this before stabilizing the API

@jiazhai
Copy link
Member

jiazhai commented Dec 10, 2019

seems already get a conclusion. would like to close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants