INT-2030 finished with initial implementation fo Redis-based MessageGroupStore
This commit is contained in:
@@ -45,6 +45,9 @@ class RedisMessageGroup implements MessageGroup {
|
||||
this.groupId = groupId;
|
||||
this.redisTemplate = redisTemplate;
|
||||
this.messageStore = messageStore;
|
||||
BoundListOperations<String, Object> unmarkedOps = this.redisTemplate.boundListOps(UNMARKED_PREFIX + this.groupId.toString());
|
||||
BoundListOperations<String, Object> markedOps = this.redisTemplate.boundListOps(MARKED_PREFIX + this.groupId.toString());
|
||||
this.rebuildLocalCache(unmarkedOps, markedOps);
|
||||
}
|
||||
|
||||
public boolean canAdd(Message<?> message) {
|
||||
@@ -231,7 +234,6 @@ class RedisMessageGroup implements MessageGroup {
|
||||
|
||||
private void rebuildLocalCache(BoundListOperations<String, Object> unmarkedOps, BoundListOperations<String, Object> markedOps){
|
||||
|
||||
|
||||
if (unmarkedOps != null){
|
||||
this.unmarked.clear();
|
||||
this.unmarked.addAll(this.buildMessageList(unmarkedOps));
|
||||
|
||||
@@ -156,9 +156,9 @@ public class RedisMessageStore extends AbstractMessageGroupStore implements Mess
|
||||
BoundSetOperations<String, Object> mGroupsOps = this.redisTemplate.boundSetOps(MESSAGE_GROUPS_KEY);
|
||||
if (!mGroupsOps.isMember(groupId)){
|
||||
mGroupsOps.add(groupId);
|
||||
group = new RedisMessageGroup(this, this.redisTemplate, groupId);
|
||||
this.messageGroups.put(groupId, group);
|
||||
}
|
||||
group = new RedisMessageGroup(this, this.redisTemplate, groupId);
|
||||
this.messageGroups.put(groupId, group);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user