Skip to content

Conversation

@yorkhellen
Copy link
Contributor

Create producer failed will return error message to user. In some case broker notify producer close and producer can't reconnect broker successfully, but we can't get the error message when producer internal reconnect broker failed. We need handle error message. so expose error to user when producer reconnect to broker failed.

@wolfstudy
Copy link
Member

@yorkhellen Good patch, can you add test case for this change?

Copy link
Contributor

@cckellogg cckellogg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do other clients (like the java one) do in this situation? How are they notified?

topic string
log log.Logger
cnx internal.Connection
err error
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hello @cckellogg , It seems that some of our Error messages are not fully exposed, such as sending failures after reaching the Backlog threshold. It seems that @yorkhellen is encapsulating their business based on the Go SDK, and may need to process specific business logic based on these specific errors. It seems that it is OK to expose the error field to the user here. This way the business can be more flexible in error handling.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide some examples on the use case and or what the business logic will do with these errors? I'm just trying to understand better. Also, I think this should not be part of the 0.7.0 release so we can think about it more. If we are going to bubble some more errors up we should come up with a good api.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I will provide a code example later to illustrate this matter.

Yes, we always include this change in 0.7.0

@wolfstudy wolfstudy modified the milestones: 0.7.0, v0.8.0 Nov 1, 2021
Copy link
Member

@wolfstudy wolfstudy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM +1

@wolfstudy
Copy link
Member

cc @cckellogg PTAL again, thanks.

callback(nil, msg, errProducerClosed)
return
}
if p.err != nil {
Copy link
Contributor

@cckellogg cckellogg Nov 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now changes the current behavior. Before if there was room the message would be added to the pending queue and sent when a new connection is established. Now the message will not be added. I'm not sure changing the default behavior is the correct approach here. Also, there could be a race condition checking the error and sending it since the the error is set in another go routine?

How do you envision your application handling this error?

@wolfstudy wolfstudy mentioned this pull request Jan 18, 2022
@wolfstudy wolfstudy modified the milestones: v0.8.0, 0.9.0 Feb 16, 2022
@freeznet freeznet modified the milestones: v0.9.0, v0.10.0 Jul 4, 2022
@RobertIndie RobertIndie modified the milestones: v0.10.0, v0.11.0 Mar 27, 2023
@RobertIndie RobertIndie modified the milestones: v0.11.0, v0.12.0 Jul 4, 2023
@RobertIndie RobertIndie modified the milestones: v0.12.0, v0.13.0 Jan 10, 2024
@RobertIndie RobertIndie modified the milestones: v0.13.0, v0.14.0 Jul 15, 2024
@RobertIndie RobertIndie modified the milestones: v0.14.0, v0.15.0 Oct 8, 2024
@RobertIndie RobertIndie modified the milestones: v0.15.0, v0.16.0 May 15, 2025
@RobertIndie RobertIndie modified the milestones: v0.16.0, v0.17.0 Jul 29, 2025
@RobertIndie RobertIndie modified the milestones: v0.17.0, v0.18.0 Oct 23, 2025
@RobertIndie RobertIndie modified the milestones: v0.18.0, v0.19.0 Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants