diff --git a/spring-integration-reference/src/delayer.xml b/spring-integration-reference/src/delayer.xml new file mode 100644 index 0000000000..9fd30ccc7d --- /dev/null +++ b/spring-integration-reference/src/delayer.xml @@ -0,0 +1,58 @@ + + + + Delayer + +
+ Introduction + + A Delayer is a simple endpoint that allows a Message flow to be delayed by a certain interval. When + a Message is delayed, the original sender will not block. Instead, the delayed Messages will be + scheduled with an instance of java.util.concurrent.ScheduledExecutorService + to be sent to the output channel after the delay has passed. This approach is scalable even for + rather long delays, since it does not result in a large number of blocked sender Threads. On the + contrary, in the typical case a thread pool will be used for the actual execution of releasing the + Messages. Below you will find several examples of configuring a Delayer. + +
+ +
+ The <delayer> Element + + The <delayer> element is used to delay the Message flow between two Message Channels. + As with the other endpoints, you can provide the "input-channel" and "output-channel" attributes, + but the delayer also requires at least the 'default-delay' attribute with the number of milliseconds + that each Message should be delayed. + ]]> + If you need per-Message determination of the delay, then you can also provide the name of a header + within the 'delay-header-name' attribute: + ]]> + In the example above the 3 second delay would only apply in the case that the header value is + not present for a given inbound Message. If you only want to apply a delay to Messages that have + an explicit header value, then you can set the 'default-delay' to 0. For any Message that has a + delay of 0 (or less), the Message will be sent directly. In fact, if there is not a positive delay + value for a Message, it will be sent to the output channel on the calling Thread. + + The delay handler actually supports header values that represent an interval in milliseconds (any + Object whose toString() method produces a value that can be parsed into a + Long) as well as java.util.Date instances representing an absolute time. + In the former case, the milliseconds will be counted from the current time (e.g. a value of 5000 + would delay the Message for at least 5 seconds from the time it is received by the Delayer). In + the latter case, with an actual Date instance, the Message will not be released until that Date + occurs. In either case, a value that equates to a non-positive delay, or a Date in the past, will + not result in any delay. Instead, it will be sent directly to the output channel in the original + sender's Thread. + + + + The default scheduler will have a thread pool of size 1. If you want to configure and provide a + different scheduler, you can provide the reference through the 'scheduler' attribute: + ]]> + +
+ +
\ No newline at end of file diff --git a/spring-integration-reference/src/filter.xml b/spring-integration-reference/src/filter.xml index c985ec397f..8b7c340845 100644 --- a/spring-integration-reference/src/filter.xml +++ b/spring-integration-reference/src/filter.xml @@ -2,7 +2,7 @@ - Message Filter + Filter
Introduction diff --git a/spring-integration-reference/src/gateway.xml b/spring-integration-reference/src/gateway.xml index 4e99fdc7f9..a285ebe9df 100644 --- a/spring-integration-reference/src/gateway.xml +++ b/spring-integration-reference/src/gateway.xml @@ -53,6 +53,16 @@ @Gateway(requestChannel="orders") void placeOrder(Order order); + }]]> + + + It is also possible to pass values to be interpreted as Message headers on the Message + that is created and sent to the request channel by using the @Header annotation: +
diff --git a/spring-integration-reference/src/spring-integration-reference.xml b/spring-integration-reference/src/spring-integration-reference.xml index 63eadc43d6..c887d57949 100644 --- a/spring-integration-reference/src/spring-integration-reference.xml +++ b/spring-integration-reference/src/spring-integration-reference.xml @@ -58,9 +58,10 @@ + - +