Jun 9th, 2010, 07:53 PM
Expiry callbacks modification
I want to implement my own message store for the following reasons.
1. I want to have a expire strategy whcih will determine whether a message group is expired or not, rather than just time out checks. Really I need this :-)
2. Want to keep track of closed correlation keys so that I don't process duplicate.
I thought of extending the Jdbc message store, but unfortunately I can't accss the expire() method and ref to callbacks from AbstractMessageStore. Do you advise to write a new class without extending?
Also the completion strategy from SI 1.0 is removed in SI 2.0. Not sure why.
I need to check if a message is in the closed correlation keys before I can process it. What is the best place to do it?
Thanks in advance
Jun 12th, 2010, 03:57 AM
The status of M4 is:
- The CompletionStrategy was renamed to ReleaseStrategy.
- All tracking capabilities were removed from the CorrelatingMessageHandler in M4.
- Expiry and tracking should now be implemented in the MessageStore
As you have noticed the extension points of the MessageStore still need some tuning. I suggest you attach a failing testcase that illustrates your use case to a JIRA issue. Then we can see how we can best support it in the framework. I expect still some stabilizing refactoring in the MessageStore area, so extending it now should be done only in experimental setups.
Jun 15th, 2010, 12:42 AM
Thanks for your reply Iwein.
A small query on ReleaseStrategy. My understanding was the ReleaseStrategy and CompletionStrategy are different. I might be completely wrong, please let me know in that case.
My understanding of ReleaseStrategy and CompletionStrategy is as follow.
ReleaseStrategy determines whether the current message group can be processed whereas the completion strategy says whether the message group is complete(i.e. no more messages with same correlation key is expected)
For example I have a message group of unknown sequence. By looking at the messages in the group I can say whether the group has all the information I want or not. Once the message group all the information I can proceed for processing, but still message group might not be complete. i.e the messages with same correlation key can arrive after processing the message group and those messages can be safely ignored. The message group can be deleted after it is complete (once all messages with same correlation key arrive).