Prasad Paravatha
Prasad Paravatha

Reputation: 618

Spring integration - recipient-list-router timeout

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

Answers (1)

Artem Bilan
Artem Bilan

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

Related Questions