-
Notifications
You must be signed in to change notification settings - Fork 1.1k
adding ReactiveFindByIndexNameSessionRepository #1205
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
adding ReactiveFindByIndexNameSessionRepository #1205
Conversation
…ssion into add-reactiveFindByIndexNameSessionRepository
@vpavic, Do i have chance thtat It'll be merged ? |
Thanks for the PR @ayudovin - we'll give this a closer look when we start working on 2.2. |
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.
Thanks for the PR @ayudovin, I've left some comments as it isn't obvious how the implementation works. You might also want to take a look at RedisOperationsSessionRepository
for inspiration (see class javadoc).
I also think that in light of #1408 and further developments around it we might want to keep the existing ReactiveRedisOperationsSessionRepository
and if we end up supporting ReactiveFindByIndexNameSessionRepository
we might do it in a separate implementation as support for indexing will likely require more complexity.
@@ -192,6 +198,24 @@ private String getSessionKey(String sessionId) { | |||
return this.namespace + "sessions:" + sessionId; | |||
} | |||
|
|||
private String getPrincipalKey(String principalName) { |
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.
If I'm not mistaken, the index key constructed here is only used for reading - what does actually write the index?
} | ||
String principalKey = getPrincipalKey(indexValue); | ||
return this.sessionRedisOperations.opsForSet() | ||
.scan(principalKey) |
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'm afraid this isn't optimal, as you would be scanning for a match each time, rather having an index that's updated on write and have reads simple.
Closing due to lack of feedback. Please comment back if you can provide more details and we can re-open the issue. |
A reactive equivalent to FindByIndexNameSessionRepository. This enhancement