diff --git a/spring-integration-reference/src/endpoint.xml b/spring-integration-reference/src/endpoint.xml index b9041aa8b0..6361b9fe74 100644 --- a/spring-integration-reference/src/endpoint.xml +++ b/spring-integration-reference/src/endpoint.xml @@ -171,14 +171,15 @@ consumer.setTransactionManager(txManager); (the other major factor being the expected volume on the channel to which the endpoint subscribes). To enable concurrency for a polling endpoint that is configured with the XML namespace support, provide the 'task-executor' reference on its <poller/> element and then provide one or more of the properties shown below: - - - -]]> + + + + + ]]> If no 'task-executor' is provided, the consumer's handler will be invoked in the caller's thread. Note that the "caller" is usually the MessageBus' task scheduler. Also, keep in mind that the 'task-executor' attribute can provide a reference to any implementation of Spring's TaskExecutor interface by diff --git a/spring-integration-reference/src/filter.xml b/spring-integration-reference/src/filter.xml new file mode 100644 index 0000000000..7968f6461f --- /dev/null +++ b/spring-integration-reference/src/filter.xml @@ -0,0 +1,57 @@ + + + + Message Filter + +
+ Introduction + + Message Filters are used to decide whether a Message should be passed along or dropped based on some criteria + such as a Message Header value or even content within the Message itself. Therefore, a Message Filter is similar + to a router, except that for each Message received from the filter's input channel, that same Message may or may + not be sent to the filter's output channel. Unlike the router, it makes no decision regarding + which Message Channel to send to but only decides whether to send. + + + In Spring Integration, a Message Filter may be configured as a Message Endpoint that delegates to some + implementation of the MessageSelector interface. That interface is itself quite + simple: message); + + }]]> + The MessageFilter constructor accepts a selector instance: + + +
+ +
+ The <filter> Element + + The <filter> element is used to create a Message-selecting endpoint. In addition to "input-channel" + and "output-channel" attributes, it requires a "ref". The "ref" may point to a MessageSelector implementation: + + + ]]> + + + Alternatively, the "method" attribute can be added at which point the "ref" may refer to any object. + The referenced method may expect either the Message type or the payload type of + inbound Messages. The return value of the method must be a boolean value. Any time the method returns 'true', + the Message will be passed along to the output-channel. Otherwise, it will be dropped. + + + ]]> + + + A common usage for Message Filters is in conjunction with a publish/subscribe channel. Many filter endpoints may + be subscribed to the same channel, and they decide whether or not to pass the Message for the next endpoint which + could be any of the supported types (e.g. Service Activator). This provides a reactive + alternative to the more proactive approach of using a Message Router with a single + point-to-point input channel and multiple output channels. + +
+ +
\ No newline at end of file diff --git a/spring-integration-reference/src/spring-integration-reference.xml b/spring-integration-reference/src/spring-integration-reference.xml index 733c261981..00c00afbe5 100644 --- a/spring-integration-reference/src/spring-integration-reference.xml +++ b/spring-integration-reference/src/spring-integration-reference.xml @@ -47,6 +47,7 @@ +