Skip to content

Allow events to trigger the creation of MessageGroup in MessageGroupStore [INT-2208] #6190

Open

Description

@spring-operator

Tony Jordan opened INT-2208 and commented

Splitters (for example) should be able to trigger the creation of a MessageGroup with a given correlationID. This would allow the action of splitting to prompt a the creation of a new MessageGroup in a specified MessageStore. An aggregator downstream using that MessageStore would "expect" messages and timeouts on that group would begin. If no messages ever arrive, the reaper will still expire the group after the timeout and a workflow could handle the situation as needed.


Affects: 2.1 M3

Issue Links:

Activity

  1. spring-operator commented on May 30, 2012

    @spring-operator
    ContributorAuthor
  2. spring-operator commented on Aug 7, 2012

    @spring-operator
    ContributorAuthor

    Oleg Zhurakousky commented

    I just thought about something. Seems to me like a cross cutting concern and can exists anywhere
    May be all we need is tow write a configurable and specialized ChannelInterceptor (e.g., GroupCreatingChannelInterceptor) and even hid its details behind the namespace. So for the default configuration we would have something like this:

    <int:channel id="myChannel" >
    	<int:interceptors>
    		<int:group-creator message-store="msRef"/>
    	</int:interceptors>
    </int:channel>
    

    The above would create message group looking for a default 'corelationId' headers in the Message.

    Or you can specify your own header

    <int:channel id="myChannel" >
    	<int:interceptors>
    		<int:group-creator message-store="msRef" expression="headers.myCorrelationId"/>
    	</int:interceptors>
    </int:channel>
    

    What I like about this approach is that it seems very intuitive to me from the cutting concern perspective hence the Channel Interceptors. And most importantly you can do it now if you chose to write your own grop creator.

  3. spring-operator commented on Aug 16, 2012

    @spring-operator
    ContributorAuthor

    Oleg Zhurakousky commented

    We'll be addressing it in the first milestone of 3.0 which should be out before SpringOne

  4. spring-operator commented on Jul 5, 2013

    @spring-operator
    ContributorAuthor

    Gary Russell commented

    See also: http://forum.springsource.org/showthread.php?139534-Question-about-MessageGroupStoreReaper-timeout

    It's not clear to me this will help because there will be nothing to discard for a "reaped" empty group.

    Maybe we could add an Application event for reaped groups and an <event:inbound-channel-adapter/> can consume it.

  5. spring-operator commented on Jan 22, 2014

    @spring-operator
    ContributorAuthor

    Artem Bilan commented

    We should keep in mind here that our MessageGroupStore implementations don't allow to create empty groups: it is created by first addMessageToGroup. And even MongoDB implementation doesn't have separate document for MessageGroup entity - group metadata is stored within each MessageDocument.

    Gary, can you explain how event from expiration may be useful?

  6. spring-operator commented on Oct 8, 2021

    @spring-operator
    ContributorAuthor

    Artem Bilan commented

    See Scatter-Gather use-case: https://stackoverflow.com/questions/69458917/scatter-gather-with-parallel-flow-timeout-in-aggregator.

    So, it scatters (distributes) the message and is ready for reply.
    Unfortunately currently its gatherer part starts working only when the first message arrives and exactly this moment is treated as group timeout creation point, when we are interested in exactly the moment when we scatter the message.

  7. spring-operator commented on Dec 1, 2022

    @spring-operator
    ContributorAuthor

    Artem Bilan commented

    We have a MessageTriggerAction contract. So, an aggregator ca implement it and react respectively: take a correlationKey and create an empty group.
    We might need to revise MessageGroupStore impls to see if they allow to create empty groups.
    My MongoDB comment might be out-dated already according to the current state of code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions