Intercepting commands and responses by supplying a custom protocol object in the Jedis Client #2635
gaspardpetit
started this conversation in
Ideas
Replies: 1 comment
-
@gaspardpetit nice idea. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I would like to know if there would be interest to allow customization of the
Protocol
currently used by aConnection
. For context, the three main use case we have areWhile this kind of monitoring can be done relatively easily from the redis instance itself, it is often preferable to do it on the client because it can provide a lot of details about the context helping understand what cause the command.
I could not find a way to enable this kind of logging, and the easiest change I could come up with replaces the usage of the
Protocol
static methods to aJedisProtocol
instance that calls theProtocol
static methods, but can also be substituted when creating theClient
. This allows the client application to provide a subclass of theJedisProtocol
with special handling around execution, response and error handling.The
JedisProtocol
would expose the three methods needed to achieve these use cases:This idea is presented as a pull request (#2633) let me know if there is interest, I am happy to adjust change if needed.
Beta Was this translation helpful? Give feedback.
All reactions