Overview

Routers are a crucial element in many messaging architectures. They consume messages from a message channel and forward each consumed message to one or more different message channels depending on a set of conditions.spring-doc.cn

Spring Integration provides the following routers:spring-doc.cn

Router implementations share many configuration parameters. However, certain differences exist between routers. Furthermore, the availability of configuration parameters depends on whether routers are used inside or outside a chain. In order to provide a quick overview, all available attributes are listed in the two following tables .spring-doc.cn

The following table shows the configuration parameters available for a router outside a chain:spring-doc.cn

Table 1. Routers Outside a Chain
Attribute router header value router xpath router payload type router recipient list route exception type router

apply-sequencespring-doc.cn

tickmark
tickmark
tickmark
tickmark
tickmark
tickmark

default-output-channelspring-doc.cn

tickmark
tickmark
tickmark
tickmark
tickmark
tickmark

resolution-requiredspring-doc.cn

tickmark
tickmark
tickmark
tickmark
tickmark
tickmark

ignore-send-failuresspring-doc.cn

tickmark
tickmark
tickmark
tickmark
tickmark
tickmark

timeoutspring-doc.cn

tickmark
tickmark
tickmark
tickmark
tickmark
tickmark

idspring-doc.cn

tickmark
tickmark
tickmark
tickmark
tickmark
tickmark

auto-startupspring-doc.cn

tickmark
tickmark
tickmark
tickmark
tickmark
tickmark

input-channelspring-doc.cn

tickmark
tickmark
tickmark
tickmark
tickmark
tickmark

orderspring-doc.cn

tickmark
tickmark
tickmark
tickmark
tickmark
tickmark

methodspring-doc.cn

tickmark

refspring-doc.cn

tickmark

expressionspring-doc.cn

tickmark

header-namespring-doc.cn

tickmark

evaluate-as-stringspring-doc.cn

tickmark

xpath-expression-refspring-doc.cn

tickmark

converterspring-doc.cn

tickmark

The following table shows the configuration parameters available for a router inside a chain:spring-doc.cn

Table 2. Routers Inside a Chain
Attribute router header value router xpath router payload type router recipient list router exception type router

apply-sequencespring-doc.cn

tickmark
tickmark
tickmark
tickmark
tickmark
tickmark

default-output-channelspring-doc.cn

tickmark
tickmark
tickmark
tickmark
tickmark
tickmark

resolution-requiredspring-doc.cn

tickmark
tickmark
tickmark
tickmark
tickmark
tickmark

ignore-send-failuresspring-doc.cn

tickmark
tickmark
tickmark
tickmark
tickmark
tickmark

timeoutspring-doc.cn

tickmark
tickmark
tickmark
tickmark
tickmark
tickmark

idspring-doc.cn

auto-startupspring-doc.cn

input-channelspring-doc.cn

orderspring-doc.cn

methodspring-doc.cn

tickmark

refspring-doc.cn

tickmark

expressionspring-doc.cn

tickmark

header-namespring-doc.cn

tickmark

evaluate-as-stringspring-doc.cn

tickmark

xpath-expression-refspring-doc.cn

tickmark

converterspring-doc.cn

tickmark

As of Spring Integration 2.1, router parameters have been more standardized across all router implementations. Consequently, a few minor changes may break older Spring Integration based applications.spring-doc.cn

Since Spring Integration 2.1, the ignore-channel-name-resolution-failures attribute is removed in favor of consolidating its behavior with the resolution-required attribute. Also, the resolution-required attribute now defaults to true.spring-doc.cn

Prior to these changes, the resolution-required attribute defaulted to false, causing messages to be silently dropped when no channel was resolved and no default-output-channel was set. The new behavior requires at least one resolved channel and, by default, throws a MessageDeliveryException if no channel was determined (or an attempt to send was not successful).spring-doc.cn

If you do desire to drop messages silently, you can set default-output-channel="nullChannel".spring-doc.cn