From 46716aca17327c4610e076a66237983c4f642895 Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Fri, 3 Jul 2009 16:23:38 +0000 Subject: [PATCH] INT-676 --- spring-integration-reference/src/chain.xml | 38 ++++++++++++++-------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/spring-integration-reference/src/chain.xml b/spring-integration-reference/src/chain.xml index 8275146dd1..25c9b7efb6 100644 --- a/spring-integration-reference/src/chain.xml +++ b/spring-integration-reference/src/chain.xml @@ -27,18 +27,25 @@ The handler chain simplifies configuration while internally maintaining the same degree of loose coupling between - components, and it is trivial to modify the configuration if at some point a non-linear arrangement is required. - The chain will be expanded into a linear setup of the listed endpoints, separated by direct - channels. The reply channel header will not be taken into account within the chain: only - after the last handler is invoked will the resulting message be forwarded onto the reply channel or the chain's output - channel. Because of this setup all handlers except the last require a setOutputChannel - implementation. The last handler only needs an output channel if the outputChannel on the MessageHandlerChain is set. - If this is not the case, the "replyChannel" header needs to be set on each message, so that it is clear where the - message needs to go. + components, and it is trivial to modify the configuration if at some point a non-linear arrangement is required. + + + Internally, the chain will be expanded into a linear setup of the listed endpoints, separated by direct channels. + The reply channel header will not be taken into account within the chain: only after the last handler is invoked + will the resulting message be forwarded on to the reply channel or the chain's output channel. Because of this + setup all handlers except the last require a setOutputChannel implementation. The last + handler only needs an output channel if the outputChannel on the MessageHandlerChain is set. + + + As with other endpoints, the output-channel is optional. If there is a reply Message at the end of the + chain, the output-channel takes precedence, but if not available, the chain handler will check for a + reply channel header on the inbound Message. + + In most cases there is no need to implement MessageHandlers yourself. The next section will focus on namespace - support for the chain element. Most Spring Integration enpoints like Service Activators and Transformers are + support for the chain element. Most Spring Integration endpoints, like Service Activators and Transformers, are suitable for use within a MessageHandlerChain. @@ -47,8 +54,8 @@ The <chain> Element The <chain> element provides an 'input-channel' attribute, and if the last element in the chain is capable - of producing reply messages, it may optionally provide an 'output-channel' attribute. The sub-elements are then - filters, transformers, splitters, and service-activators. The last element may also be a router or aggregator. + of producing reply messages (optional), it also supports an 'output-channel' attribute. The sub-elements are then + filters, transformers, splitters, and service-activators. The last element may also be a router. @@ -57,9 +64,12 @@ ]]> - The <header-enricher> element used in the above example will set a message header with name "foo" and value "bar" on the message. - A header enricher is a specialization of Transformer that touches only header values. You could obtain the same result by - implementing a MessageHandler that did the header modifications and wiring that as a bean. + + The <header-enricher> element used in the above example will set a message header with name "foo" and + value "bar" on the message. A header enricher is a specialization of Transformer that touches only header + values. You could obtain the same result by implementing a MessageHandler that did the header modifications + and wiring that as a bean. + \ No newline at end of file