Provide access to stored messages from the ChannelMessageStore API
It should be possible to use the public API of ChannelMessageStore to get access to stored messages without consuming those messages.
The current implementation always yields an empty message group:
/**
* Not fully used. Only wraps the provided group id.
*/
@Override
public MessageGroup getMessageGroup(Object groupId) {
return getMessageGroupFactory().create(groupId);
}
While implementing #3446 I've noticed that MongoDbChannelMessageStore extends AbstractConfigurableMongoDbMessageStore with its lazyLoadMessageGroups = true by default and give us a full access to the stored messages, either via getMessagesForGroup(Object groupId) or new streamMessagesForGroup(Object groupId).
So, we probably need just pull a couple MessageGroupStore method up into BasicMessageGroupStore or have their respective implementation in the ChannelMessageStore. And also revise a messageGroupFactory to be lazy for the JdbcChannelMessageStore and RedisChannelMessageStore, respectively.
Although it's probably still won't be so straightforward without any breaking changes. So, still 6.0.