Annotation Interface Aggregator
@Target({METHOD,ANNOTATION_TYPE})
@Retention(RUNTIME)
@Documented
@Repeatable(Aggregators.class)
public @interface Aggregator
Indicates that a method is capable of aggregating messages.
A method annotated with @Aggregator may accept a collection of Messages or Message payloads and should return a single Message or a single Object to be used as a Message payload.
- Author:
- Marius Bogoevici, Oleg Zhurakousky, Artem Bilan, Chris Bono
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionTheSmartLifecycle
autoStartup
option.Specify aSmartLifecycle
phase
option.Specify whether messages that expired should be aggregated and sent to theoutputChannel()
orreplyChannel
from message headers.Specify the maximum amount of time in milliseconds to wait when sending a replyMessage
to theoutputChannel()
.
-
Element Details
-
inputChannel
String inputChannel- Returns:
- The channel name for receiving messages to be aggregated
- Default:
- ""
-
outputChannel
String outputChannel- Returns:
- The channel name for sending aggregated result messages
- Default:
- ""
-
discardChannel
String discardChannel- Returns:
- The channel name for sending discarded messages (due to a timeout)
- Default:
- ""
-
sendTimeout
String sendTimeoutSpecify the maximum amount of time in milliseconds to wait when sending a replyMessage
to theoutputChannel()
. Defaults to30
seconds. It is applied only if the output channel has some 'sending' limitations, e.g.QueueChannel
with a fixed 'capacity' and is currently full. In this case aMessageDeliveryException
is thrown. The 'sendTimeout' is ignored in case ofAbstractSubscribableChannel
implementations. Can be specified as 'property placeholder', e.g.${spring.integration.sendTimeout}
.- Returns:
- The timeout for sending results to the reply target (in milliseconds)
- Default:
- ""
-
sendPartialResultsOnExpiry
String sendPartialResultsOnExpirySpecify whether messages that expired should be aggregated and sent to theoutputChannel()
orreplyChannel
from message headers. Messages are expired when their containingMessageGroup
expires. One of the ways of expiring MessageGroups is by configuring aMessageGroupStoreReaper
. However, MessageGroups can alternatively be expired by simply callingMessageGroupStore.expireMessageGroup(groupId)
. That could be accomplished via a ControlBus operation or by simply invoking that method if you have a reference to theMessageGroupStore
instance. Defaults tofalse
. * Can be specified as 'property placeholder', e.g.${spring.integration.sendPartialResultsOnExpiry}
.- Returns:
- Indicates whether to send an incomplete aggregate on expiry of the message group
- Default:
- ""
-
autoStartup
String autoStartupTheSmartLifecycle
autoStartup
option. Can be specified as 'property placeholder', e.g.${foo.autoStartup}
. Defaults totrue
.- Returns:
- the auto startup
boolean
flag.
- Default:
- ""
-
phase
String phaseSpecify aSmartLifecycle
phase
option. DefaultsInteger.MAX_VALUE / 2
forPollingConsumer
andInteger.MIN_VALUE
forEventDrivenConsumer
. Can be specified as 'property placeholder', e.g.${foo.phase}
.- Returns:
- the
SmartLifecycle
phase.
- Default:
- ""
-
poller
Poller poller- Returns:
- the
Poller
options for a polled endpoint (PollerMetadata
). Mutually exclusive withreactive()
.
- Default:
- @org.springframework.integration.annotation.Poller("\n\t\t\n\t\t\n\ue000\ue001\ue002\n\t\t\t\t\n")
-
reactive
Reactive reactive- Default:
- @org.springframework.integration.annotation.Reactive("\n\t\t\n\t\t\n\ue000\ue001\ue002\n\t\t\t\t\n")
-