Announcement Announcement Module
No announcement yet.
MessageStore / Enumerate messages Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • MessageStore / Enumerate messages

    I was looking at MessageStore and according to the documentation it can be used to "mitigate the risk" of messages being "lost in the event of a system failure".

    however, the interface does not allow messages to be enumerated and instead, they can only be retrieved by id. my assumption then, is that the ids must be kept in memory. so when the system does fail, any messages in the store are not lost, but they cannot be used either.

    so by the looks of it, the only benefit you receive from the message store is some degree of asynchronicity and potentially lowered memory use., but not preservation of messages during a system failure.

    am I missing something here?

  • #2
    Actually you can. You just have to use MessageGroupStore which allows you to correlate stored messages as part of some group identifier. Remember the same MessageGroupStore is used to support persistent QueueChannel and as such it must support FIFO semantics.
    Look at this method:
    * Polls Message from this {@link MessageGroup} (in FIFO style if supported by the implementation)
    * while also removing the polled {@link Message}
    Message<?> pollMessageFromGroup(Object groupId);