diff --git a/spring-integration-reference/src/endpoint.xml b/spring-integration-reference/src/endpoint.xml index de5a65a2b2..973f700c41 100644 --- a/spring-integration-reference/src/endpoint.xml +++ b/spring-integration-reference/src/endpoint.xml @@ -252,19 +252,19 @@ consumer.setTransactionManager(txManager); As mentioned in the background section for Polling Consumers above, you can also configure a Polling Consumer in such a way as to emulate event-driven behavior. With a long receive-timeout and a short interval-trigger, - you can ensure a very timely reaction to arriving messages even on a polled message source. - - - A good use case that demonstrates how this approach could be applied is event-driven files via Spring - Integration's inbound-channel-adapter in the file namespace where a file dropped - into a directory would essentially become an event. That file will be picked up nearly instantaneously and - sent through the process. - - - - - ]]> + you can ensure a very timely reaction to arriving messages even on a polled message source. Note that this + will only apply to sources that have a blocking wait call with a timeout. For example, the File poller does + not block, each receive() call returns immediately and either contains new files or not. Therefore, even if + a poller contains a long receive-timeout, that value would never be usable in such a scenario. On the other + hand when using Spring Integration's own queue-based channels, the timeout value does have a chance to + participate. The following example demonstrates how a Polling Consumer will receive Messages nearly + instantaneously. + + + + + ]]> Using this approach does not carry much overhead since internally it is nothing more then a timed-wait thread which does not require nearly as much CPU resource usage as a thrashing, infinite while loop for example.