[mule-user] Correlation Aggregrator

0 views
Skip to first unread message

adu1

unread,
Sep 27, 2009, 1:34:26 PM9/27/09
to us...@mule.codehaus.org

I have a service component that sends out messages to multiple endpoints.
Depending on the logic, it could send out the message to 1, 2 or more than 3
end-points. The response is required to be collected and returned. I wanted
to understand how the correlation aggregrator or the response correlator
aggregrator works. How do these, i.e aggregrators, inbound-endpoints know
that that it will receive 1 , 2 or more than 3 responses. What does the
application have to do to ensure that the aggregrator inbound endpoints have
the context of the messages sent before. Do such routers wait for a default
time period and then report the Event Groups. I had a look at the loan
broker example but do not understand how the aggregrator inbound router
knows that how many banks will respond.
--
View this message in context: http://www.nabble.com/Correlation-Aggregrator-tp25635635p25635635.html
Sent from the Mule - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Antoine Borg

unread,
Sep 28, 2009, 2:15:26 AM9/28/09
to us...@mule.codehaus.org
Hello,

The aggregator routers (not aggregator endpoints) have logic built into
them that enables the router to know when all constituent parts of a
message have been received.

Example:

If I want a router that will wait for message A, message B and message
C, the routing code in the router will know that:
- If message A is received, it will wait.
- if message B or C is received, it will wait.
- Once the last message is received, it will combine the three
(aggregate) into a new message and pass that to the component.

Aggregators can aggregate based upon type of message, number of messages
or message size perhaps.

In your case, you need to develop a new aggregator router of your own,
it seems. Some more info is available on my blog:
http://ricston.com/blog/?p=77

HTH

A


adu1 wrote:
> I have a service component that sends out messages to multiple endpoints.
> Depending on the logic, it could send out the message to 1, 2 or more than 3
> end-points. The response is required to be collected and returned. I wanted
> to understand how the correlation aggregrator or the response correlator
> aggregrator works. How do these, i.e aggregrators, inbound-endpoints know
> that that it will receive 1 , 2 or more than 3 responses. What does the
> application have to do to ensure that the aggregrator inbound endpoints have
> the context of the messages sent before. Do such routers wait for a default
> time period and then report the Event Groups. I had a look at the loan
> broker example but do not understand how the aggregrator inbound router
> knows that how many banks will respond.
>

--

Antoine Borg, Director of Services | Tel: +32 28 504 696
ricston Ltd., BP 2, 1180 Uccle, Brussels, BELGIUM

See our full schedule of Mule and Android courses:
http://www.ricston.com/courses/schedules/

email: _antoin...@ricston.com <mailto:antoin...@ricston.com> |
blog: blog.ricston.com <http://blog.ricston.com> | web: ricston.com
<http://www.ricston.com/>

adu1

unread,
Sep 28, 2009, 3:57:21 AM9/28/09
to us...@mule.codehaus.org

I need a router that forwards the first response message it receives and
performs some other action on the responses that follow - logging or
forwarding it to another endpoint. Is a router the right way for such a
requirement or should it be a service component. If the router forwards the
first response , will that thread be lost and it will not be able track the
constituents parts that follow later.
I do not want the router to wait for all messges and then decide what to do.
Instead act on the first but also act on the ones that follow, albeit in a
different way. So it is not exactly a aggregrator router !
Which classes have this wait logic / which interfaces to implement and also
the logic that ties the outbound messages to in the inbound messages. , i.e
the inbound router should know that it has to wait for x number fo messages.
Thanx , I will go through your blog to understand more about aggregrator
routers

--
View this message in context: http://www.nabble.com/Correlation-Aggregrator-tp25635635p25641678.html


Sent from the Mule - User mailing list archive at Nabble.com.

Antoine Borg

unread,
Sep 29, 2009, 2:30:51 AM9/29/09
to us...@mule.codehaus.org
If you want a router to maintain state (handle msg #1 and then wait for
the responses and handle those) then an aggregator is not what you
want. However, an easier and simpler way to do this is to have an
aggregator router that knows which message and response goes together
through the use of a Correlation ID which is stored in the MuleMessage
properties.

A

Reply all
Reply to author
Forward
0 new messages