diff --git a/docs/src/reference/docbook/router.xml b/docs/src/reference/docbook/router.xml index e06166b650..1c9b63a03e 100644 --- a/docs/src/reference/docbook/router.xml +++ b/docs/src/reference/docbook/router.xml @@ -217,24 +217,24 @@ Router parameters have been more standardized across all router implementations - in Spring Integration ??TBD??. Consequently, some parameters were removed or - added leaving the possibility of breaking older Spring Integration based applications. + in Spring Integration 2.1. Consequently, there are a few minor changes that + leave the possibility of breaking older Spring Integration based applications. - Since Spring Integration ??TBD?? the "ignore-channel-name-resolution-failures" - attribute was renamed to "channel resolution-required". Also, "channel resolution-required" - defaults to "true". - - Prior to an attribute "resolution-required" existed that defaulted to false + Since Spring Integration 2.1 the "ignore-channel-name-resolution-failures" + attribute was removed in favor of consolidating its behavior with the + "resolution-required" attribute. Also, the "resolution-required" attribute + now defaults to "true". + + Prior to these changes, the "resolution-required" attribute defaulted to false causing messages to be dropped silently when no channel was resolved and no "default-output-channel" was set. The new behavior will require at least one resolved channel and by default - will throw an Exception if no channel was determined (and the sent to it + will throw an Exception if no channel was determined (or an attempt to send was not successful). - "resolution-required" is now removed. If you desire to drop messages silently - set "default-output-channel='nullChannel'". + If you do desire to drop messages silently simply set "default-output-channel='nullChannel'".
diff --git a/spring-integration-core/src/main/resources/org/springframework/integration/config/xml/spring-integration-2.1.xsd b/spring-integration-core/src/main/resources/org/springframework/integration/config/xml/spring-integration-2.1.xsd index ae1be1d534..b3aa531064 100644 --- a/spring-integration-core/src/main/resources/org/springframework/integration/config/xml/spring-integration-2.1.xsd +++ b/spring-integration-core/src/main/resources/org/springframework/integration/config/xml/spring-integration-2.1.xsd @@ -2064,10 +2064,13 @@ endpoint itself is a Polling Consumer for a channel with a queue. The "ref" attribute references the bean name of a custom - Router implementation that extends AbstractMessageRouter. + Router implementation. Typically that implementation will + be a simple POJO, but it may extend AbstractMessageRouter. - Alternatively, the "ref" attribute may point to a - simple POJO that contains the @Router annotation. + Provide the "method" attribute as well to clarify which + method should be invoked, Alternatively, the "ref" attribute + may point to an instance that contains the @Router annotation + on one of its methods. Instead of using the "ref" attribute you may also provide the custom Router implementation as an inner bean @@ -2077,6 +2080,9 @@ endpoint itself is a Polling Consumer for a channel with a queue. and an inner handler definition in the same Router configuration is not allowed, as it creates an ambiguous condition, and an Exception will be thrown. + + Additionally, instead of using "ref" and "method" at all, + you can use the "expression" attribute (see description below). @@ -2093,13 +2099,14 @@ endpoint itself is a Polling Consumer for a channel with a queue. method name using the "method" attribute. The referenced method may return either a MessageChannel - or a String type.Additionally, the method may return + or a String type. Additionally, the method may return either a single value or a collection. If a collection is returned, the reply message will be sent to multiple channels. Specifying a "method" attribute applies the same behavior - as when using the @Router annotation within POJOs. + as when using the @Router annotation on a single method + within the object pointed to by the "ref". @@ -2111,7 +2118,7 @@ endpoint itself is a Polling Consumer for a channel with a queue. - SpEL Expression to be evaulated at runtime. Allows you + SpEL Expression to be evaluated at runtime. Allows you to implement simple computations without implementing a custom POJO router. Generally, the SpEL expression is evaluated and the result is mapped to a channel using @@ -2120,9 +2127,14 @@ endpoint itself is a Polling Consumer for a channel with a queue. However, if no "mapping" sub-element is present, the SpEL Expression will evaluate to a channel name directly. - A SpEL expression may return also a Collection. Whenever + A SpEL expression may also return a Collection. Whenever the expression returns multiple channel values the Message will be forwarded to each channel. + + Note that SpEL supports bean-references within expressions + using the @ sign. This enables more sophisticated mapping + of Message content to method arguments, e.g.: + expression="@someBean.someMethod(payload.foo, headers.bar)" @@ -2157,13 +2169,12 @@ endpoint itself is a Polling Consumer for a channel with a queue.