diff --git a/docs/src/reference/docbook/chain.xml b/docs/src/reference/docbook/chain.xml
index 4cbe973206..20056e958d 100644
--- a/docs/src/reference/docbook/chain.xml
+++ b/docs/src/reference/docbook/chain.xml
@@ -21,7 +21,9 @@
this value should be set to 'true' (the default is false) so that the dispatcher will know that the Message was
rejected and as a result will attempt to pass the Message on to other subscribers. If the Exception were not
thrown, then it would appear to the dispatcher as if the Message had been passed on successfully even though
- the Filter had dropped the Message to prevent further processing.
+ the Filter had dropped the Message to prevent further processing. If you do indeed want
+ to "drop" the Messages, then the Filter's 'discard-channel' might be useful since it does give you a chance
+ to perform some operation with the dropped message (e.g. send to a JMS queue or simply write to a log).
@@ -29,16 +31,17 @@
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.
+ Internally, the chain will be expanded into a linear setup of the listed endpoints, separated by anonymous 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.
+ setup all handlers except the last required to implement the MessageProducer interface (which provides a
+ 'setOutputChannel()' method). 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.
+ reply channel header on the inbound Message as a fallback.
@@ -57,43 +60,45 @@
filters, transformers, splitters, and service-activators. The last element may also be a router.
-
+
]]>
- 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 named "foo" with a value
+ of "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, but the header-enricher is obviously a simpler option.
- Sometimes you need to make a nested call to another chain from within the chain and then come
+ Sometimes you need to make a nested call to another chain from within a chain and then come
back and continue execution within the original chain.
- To accomplish this you can utilize Messaging Gateway by including a light configured <gateway> element.
+ To accomplish this you can utilize a Messaging Gateway by including a <gateway> element.
For example:
-
+
-
+
-
+
+
-
+
-
+
+
@@ -102,13 +107,16 @@
]]>
-In the above example the nested-chain-a will be called at the end of main-chain processing by the 'gateway' element
-configured there. While in nested-chain-a a call to a nested-chain-b will be made after header enrichment and then it will
-come back to finish execution in nested-chain-b finally getting back to the main-chain.
-When the light version of <gateway> element is defined in the chain SI will construct an instance SimpleMessagingGateway
- (no need to provide a service-interface attribute) which will take the message in its current state and will place it on the channel defined via
- the request-channel attribute.
- Upon processing Message will be returned to the gateway and continue its journey within the current chain.
+ In the above example the nested-chain-a will be called at the end of
+ main-chain processing by the 'gateway' element configured there. While in
+ nested-chain-a a call to a nested-chain-b will be made
+ after header enrichment and then it will come back to finish execution in nested-chain-b.
+ Finally the flow returns to the main-chain. When the nested version of a <gateway>
+ element is defined in the chain, it does not require the service-interface attribute.
+ Instead, it simple takes the message in its current state and places it on the channel defined via
+ the request-channel attribute. When the downstream flow initiated by that gateway completes,
+ a Message will be returned to the gateway and continue its journey within
+ the current chain.