-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: initial implementation of get and set #3
Conversation
This wraps the `RedisCodec` which converts to/from ByteBuffer. Because the Momento client accepts either byte arrays or Strings, we provide this wrapper for internal convenience.
We have a real test now!
Also updates the slf4j and logback versions.
Previoulsy gradle was caching test runs that completed. Since we run the tests with an environment variable to toggle redis vs momento, we do not want that behavior. We also enable logging.
Turn the redis tests into a single step vs a separate job.
|
||
@Override | ||
public Mono<String> asking() { | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious how we decided between returning null and throwing e.g. NotImplementedException? not a blocker for this PR but wondering what your thoughts are.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am going to throw an exception in a future PR. (mentioned at the bottom of the PR description :))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks. Sorry I missed that in the description.
Adds an initial implementation of the
MomentoRedisReactiveClient
and integration tests:MomentoRedisReactiveClient
which implements the Lettuce Reactive Redis command set interface. This is a client side proxy that takes a Momento cache client and cache name as dependencies in the constructor. Implements theget
andset
commands in the first cut.MomentoRedisReactiveCommands
with the specific commands we have implemented. This allows a developer the confidence to only use the commands we have authored.RedisCodec
wrapperRedisCodecByteArrayConverter
for Momento: Lettuce is generic over the key and value types, allowing a developer to use whatever they want, provided they pass aRedisCodec
in the constructor to marshal/unmarshal the data toByteBuffer
. Because Momento takesbyte[]
and notByteBuffer
we provide this wrapper for internal convenience.MomentoLettuceExceptionMapper
to convert Momento exceptions back to Lettuce exceptions. The relevant exception type here is the timeout exception.BaseTestClass
sets up the reactive client, which may be backed by either Lettuce or our Momento implementation. To toggle Redis vs Momento, setREDIS=1
in the environment for Redis. The single test classScalarCommandTest
shows how we have a single set of integration tests that can run.In a future PR we will update the other commands to throw an exception if not implemented.