Reputation: 618
Anyone used Spring recipient-list-router with timeout attribute?
<int:recipient-list-router id="customRouter" input-channel="routingChannel"
timeout="1234"
ignore-send-failures="true"
apply-sequence="true">
<int:recipient channel="channel1"/>
<int:recipient channel="channel2"/>
</int:recipient-list-router>
timeout : The timeout attribute specifies the maximum amount of time in milliseconds to wait, when sending Messages to the target Message Channels. By default the send operation will block indefinitely.
I am trying to figure what would be a good amount of time to wait before moving on to next channel.
Upvotes: 2
Views: 449
Reputation: 121442
Right now it sounds like:
<xsd:attribute name="timeout" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
Specify the maximum amount of time in milliseconds to wait
when sending Messages to the target MessageChannels if blocking
is possible (e.g. a bounded queue channel that is currently full).
By default the send will block indefinitely.
DEPRECATED in favor of 'send-timeout' for consistency with other elements.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
Pay attention to the bounded queue channel
phrase. So, this is applied via MessagingTemplate
only when your target channel is restricted by the size QueueChannel
.
So, if your channel is DirectChannel
, there is no any possibility to wait. Just because the AbstractMessageRouter
is as a simple loop
logic and the send
and therefore handling process is performed on the same thread.
Upvotes: 2