-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
ping method analog #85
Comments
Issue an ApiVersions request. Pinging goes against the client internally not connecting unless necessary. |
thanks |
Wow, nice. Thank you |
I'm thinking to add this, after a few more requests. |
What would the ping method do? Just an ApiVersions request (which would also be valid without authentication) or also a metadata request for instance? Would that be part of the admin client or what's the idea? |
I'm thinking: // Ping returns whether any broker is reachable, iterating over any discovered broker
// or seed broker until one returns a successful response to an ApiVersions request.
// Each request is retried up to 3 times depending on the how the request fails.
// If all requests fail, this returns final error.
func (cl *Client) Ping() error
type PingBrokerError struct {
Broker BrokerMetadata
Err error
}
type PingBrokerErrors []PingBrokerError
// Any returns the first error, if any.
func (es PingBrokerErrors) Any() error
// PingAll iterates through all discovered brokers and issues an ApiVersions request
// to each to test broker connectivity. If there are currently no discovered brokers,
// this iterates through all seed brokers.
func (cl *Client) PingAll() PingBrokerErrors I'm not yet settled on the API for |
I'm prefer to have Ping(context.Context) error method. |
I've added |
database/sql has ping method to understand that driver connected to database instance
does it possible to force connect Client to broker and get some results ? Mostly for me this is needed to check that broker address properly set and broker available.
The text was updated successfully, but these errors were encountered: