You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Fix Kotlin deprecation warning in the test
* Replace wrong `IntervalTrigger` mentioning in the docs to the proper `PeriodicTrigger`
* Fix code snippet in the `channel-adapter.adoc`
Copy file name to clipboardExpand all lines: src/reference/asciidoc/channel-adapter.adoc
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,6 +124,8 @@ However, if you are sure that your method can return null and you need to poll f
124
124
====
125
125
126
126
Starting with version 5.5, a `0` value for `max-messages-per-poll` has a special meaning - skip the `MessageSource.receive()` call altogether, which may be considered as pausing for this inbound channel adapter until the `maxMessagesPerPoll` is changed to a non-zero value at a later time, e.g. via a Control Bus.
127
+
128
+
Also see <<./endpoint.adoc#global-default-poller>> for more information.
127
129
=====
128
130
129
131
[[channel-adapter-namespace-outbound]]
@@ -175,7 +177,6 @@ fun outboundChannelAdapterFlow(myPojo: MyPojo) =
175
177
If the channel being adapted is a `PollableChannel`, you must provide a poller sub-element (the `@Poller` sub-annotation on the `@ServiceActivator`), as the following example shows:
Spring Integration currently provides two implementations of the `Trigger` interface: `IntervalTrigger` and `CronTrigger`.
103
-
The `IntervalTrigger` is typically defined with a simple interval (in milliseconds) but also supports an `initialDelay` property and a boolean `fixedRate` property (the default is `false` -- that is, no fixed delay).
102
+
The `PeriodicTrigger` is typically defined with a simple interval (in milliseconds) but also supports an `initialDelay` property and a boolean `fixedRate` property (the default is `false` -- that is, no fixed delay).
104
103
The following example sets both properties:
105
104
106
105
====
107
106
[source,java]
108
107
----
109
-
IntervalTrigger trigger = new IntervalTrigger(1000);
108
+
PeriodicTrigger trigger = new PeriodicTrigger(1000);
110
109
trigger.setInitialDelay(5000);
111
110
trigger.setFixedRate(true);
112
111
----
@@ -316,22 +315,87 @@ It is also possible to create top-level pollers, in which case only a `ref` attr
316
315
NOTE: The `ref` attribute is allowed only on the inner poller definitions.
317
316
Defining this attribute on a top-level poller results in a configuration exception being thrown during initialization of the application context.
318
317
319
-
====== Global Default Pollers
318
+
[[global-default-poller]]
319
+
====== Global Default Poller
320
320
321
321
To simplify the configuration even further, you can define a global default poller.
322
-
A single top-level poller within an `ApplicationContext` may have the `default` attribute set to `true`.
323
-
In that case, any endpoint with a `PollableChannel` for its input channel, that is defined within the same `ApplicationContext`, and has no explicitly configured `poller` sub-element uses that default.
322
+
A single top-level poller component in XML DSL may have the `default` attribute set to `true`.
323
+
For Java configuration a `PollerMetadata` bean with the `PollerMetadata.DEFAULT_POLLER` name must be declared in this case.
324
+
In that case, any endpoint with a `PollableChannel` for its input channel, that is defined within the same `ApplicationContext`, and has no explicitly configured `poller` uses that default.
324
325
The following example shows such a poller and a transformer that uses it:
<!-- No <poller/> sub-element is necessary, because there is a default -->
331
394
<int:transformer input-channel="pollable"
332
395
ref="transformer"
333
396
output-channel="output"/>
334
397
----
398
+
====
335
399
336
400
[[transaction-support]]
337
401
====== Transaction Support
@@ -412,7 +476,7 @@ You should also keep in mind that the `task-executor` attribute can provide a re
412
476
The `executor` element shown earlier is provided for convenience.
413
477
414
478
As mentioned earlier in the <<endpoint-pollingconsumer,background section for polling consumers>>, you can also configure a polling consumer in such a way as to emulate event-driven behavior.
415
-
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.
479
+
With a long receivetimeout and a short interval in the trigger, you can ensure a very timely reaction to arriving messages even on a polled message source.
416
480
Note that this applies only to sources that have a blocking wait call with a timeout.
417
481
For example, the file poller does not block.
418
482
Each `receive()` call returns immediately and either contains new files or not.
0 commit comments