PDA

View Full Version : Aggregator timeout



paul.mckenzie
Jan 6th, 2010, 07:59 AM
Hi

My aggregator was timing-out, which took me a little while to spot.

Would it be useful if there were some way of defining an optional onTimeout method which is called after the timeout period? This would at least let me log an error.

Paul

Mark Fisher
Jan 6th, 2010, 08:24 AM
I like that idea. In fact, for 2.0 (where Aggregator is being refactored quite a bit), we could consider something like a TimeoutHandler with a handle(MessageGroup messagesReceivedPriorToTimeout). The default impl could still be based on the simple boolean flag for whether or not to send partial results on timeout.

Does that make sense? If so, can you raise a JIRA request and provide a link to this thread?

Thanks,
Mark

iwein
Jan 13th, 2010, 08:25 AM
I don't completely see yet how discardChannel is inadequate in this use case. It would be great if you could elaborate on that a bit.

paul.mckenzie
Jan 13th, 2010, 08:41 AM
I want to be able to do one thing in the event of a timeout, rather than n things, once per late message.

In this case, neither a partial result nor the late messages are any use to me.

Paul

iwein
Jan 13th, 2010, 04:17 PM
I want to be able to do one thing in the event of a timeout, rather than n things, once per late message.

In this case, neither a partial result nor the late messages are any use to me.


That's very clear, thanks!

annuk
May 31st, 2011, 02:31 AM
Hi,

I have specified a timeout for my aggregator.
I want the aggregator to discard the message if all messages are not recived within a specific timeout.
I have specified a discard channel for it too.
But my aggregator is not timing out.
It works fine when there is a duplicate message.It redirects to the discard channel.

My configuration is:

<int-http:inbound-channel-adapter id="smsInboundAdapter"
channel="smsChannel" name="/smsInboundAdapter.htm" supported-methods="GET" />

<int:channel id="smsChannel" />

<int:transformer id="smsToMessageConverter"
input-channel="smsChannel" output-channel="aggregationChannel" >

<bean class="sms.communication.SMSToMessageConverter" />
</int:transformer>

<int:channel id="aggregationChannel" />

<int:channel id="errorChannel" />

<int:aggregator method="add" input-channel="aggregationChannel"
output-channel="completeMessageChannel"
discard-channel="errorChannel" send-timeout="3" >
<bean class="sms.communication.MessageAggragator" />
</int:aggregator>


<int:outbound-channel-adapter ref="errorUnWrapper"
channel="errorChannel" />

<int:channel id="completeMessageChannel" />

<int:outbound-channel-adapter ref="messageProcessor"
channel="completeMessageChannel" />

<bean id="messageProcessor" class="sms.communication.MessageProcessor" />

<bean id="errorUnWrapper" class="sms.communication.ErrorUnWrapper" />


I am considering the send timeout value in milliseconds..


Please help.