Results 1 to 5 of 5

Thread: Different expiration time for message groups in aggegator

  1. #1
    Join Date
    Aug 2009
    Location
    Lima, Perú
    Posts
    38

    Default Different expiration time for message groups in aggegator

    Hello,

    I'm using an Aggregator (using the default in memory storage) as a sort of temporary repository useful for the logic of my flow.

    Now I need to establish different expiration times for the message groups (those times will depend on some application specific traits of the stored messages.) At first I thought in extending SimpleMessageGroup and overriding the getTimestamp() method to some future time (and expiring the MessageStore with a timeout of zero, every second.) The problem is that I can't find a way to inject such a derived class.

    Looking in SimpleMessageStore I've found:

    Code:
    	public MessageGroup getMessageGroup(Object groupId) {
    		Assert.notNull(groupId, "'groupId' must not be null");
    		SimpleMessageGroup group = groupIdToMessageGroup.get(groupId);
    		if (group == null) {
    			return new SimpleMessageGroup(groupId);
    		}
    		return new SimpleMessageGroup(group);
    	}
    Any suggestion? Maybe override SimpleMessageStore.getMessageGroup()?

    Thanks!

  2. #2
    Join Date
    Aug 2009
    Location
    Lima, Perú
    Posts
    38

    Default

    Hello, some idea? or I'm missing something?

  3. #3
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,036

    Default

    No, you are not missing anything; we would need to add a strategy to allow the creation of custom Message Groups (e.g. MessageGroupCreator). But, this has implications on MessageGroupStores too, in that we would need to expose some mechanism to persist any metadata that the custom group might need to persist over JVM restarts.

    Please go ahead and open an Improvement JIRA.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  4. #4
    Join Date
    Aug 2009
    Location
    Lima, Perú
    Posts
    38

    Default

    Thank you Gary.

    https://jira.springsource.org/browse/INT-2510

    Some idea for a workaround?

  5. #5
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,036

    Default

    Maybe you could write a custom MessageGroupStore (maybe subclass one of the standard ones, such as SimpleMessageStore), and override expireMessageGroups() to use a custom algorithm?
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •