-
Notifications
You must be signed in to change notification settings - Fork 987
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
Add support for CommandListeners #1382
Comments
Thanks. We could introduce an API along the lines of:
that get notified upon command events from Command events would typically hold the command type, arguments and the output (for success) and the error/exception for the failed case. We also need to consider that commands may get canceled (i.e. connection closed) from the endpoint implementation which would ultimately call |
That's almost exactly what I expected to see. |
Do you have an example of how you would like to attach data to a command or how the API for the context should look like? |
I think it should look like typical key-value storage. https://github.com/r2dbc/r2dbc-proxy/blob/main/src/main/java/io/r2dbc/proxy/core/QueryExecutionInfo.java#L180 |
Move events from models.events to event.command. Move CommandListener configuration from ClientResources to AbstractRedisClient.addListener. Consider changed writer chain in RedisChannelHandler.setTimeout. Add tests for standalone and Redis Cluster operations. Remove generics from command events to simplify interaction and listener implementation. Replace generic ExecutionException with ExceptionFactory usage. Original pull request: #1424.
No place to configure CommandListener found in ClientResources |
Command listeners are configured via |
It would be great to have a handler API of executing commands.
I think there are a lot of possible use cases.
For example, I want to log all executing commands (input and output).
Current logging is not very human-friendly, actually :)
My temporary solution looks like this, but I don't think it's quite elegant:
https://gist.github.com/SokoMishaLov/207c8082594685daa44cbd60127960a8
Thanks!
The text was updated successfully, but these errors were encountered: