Spring integration recipient-list-router issue

I am using a recipient-list-router in my application to send message to different JMS outbound adapters as shown here:

queue -> recipient-list-router  -> queue1 -> JMS outbound adapter 1
                                -> queue2 -> JMS outbound adapter 2

I am facing two issues:

  1. selector-expression runs initially only, not for each message forwarded
  2. if any JMS broker is down then message is not getting sent to another JMS broker.

Following is the XML configuration:

<i:recipient-list-router input-channel="result-pack-output-channel" >
           <i:recipient channel="result-pack-output-channel-1" 
                          selector-expression="#{utils.isHourInInterval('LN')}"/>
            <i:recipient channel="result-pack-output-channel-2" 
                          selector-expression="#{utils.isHourInInterval('NY')}"/>
            <i:recipient channel="result-pack-output-channel-3" 
                        selector-expression="#{utils.isHourInInterval('HK')}" />
            <i:recipient channel="result-pack-output-channel-4" 
                        selector-expression="#{utils.isHourInInterval('ME')}"/> 
 </i:recipient-list-router> 

1 answer

  • answered 2018-07-12 13:06 Gary Russell

    #{...} expressions are evaluated once, during context initialization. Here, you need runtime expressions. In runtime expressions you reference other beans with @ - so...

    selector-expression="@utils.isHourInInterval('LN')"
    

    EDIT

    I missed your second question - use ignore-send-failures="true">.