|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||
@Retention(value=RUNTIME) @Target(value=METHOD) public @interface Subscribe
Consumers for EventBus must annotate their consumer methods with this annotation.
A consumer is asynchronous, however it can choose to batch events consumed at a time using a batching strategy.
A consumer can indicate if it favors synchronous event consumption, provided, it is allowed in the current
environment, by setting the property SyncSubscribersGatekeeper.ALLOW_SYNC_SUBSCRIBERS to true.
A consumer is always assumed to be thread-safe.
Any method annotated with this must have one and only one argument which is the event object that it is supposed to
handle.
| Optional Element Summary | |
|---|---|
int |
batchAge
The threshold for the age of the batch in milliseconds since the first entry was added. |
Subscribe.BatchingStrategy |
batchingStrategy
Returns the batching strategy for this subscriber. |
int |
batchSize
The threshold for the size of the batch. |
java.lang.String |
name
A name for this subscriber, this is only required if you want to have a dynamic configuration via SubscriberConfigProvider AND each subscriber method in the class has a different configuration. |
int |
queueSize
The queue size for the consumer. |
boolean |
syncIfAllowed
A backdoor in the eventbus to allow synchronous events consumption. |
public abstract java.lang.String name
SubscriberConfigProvider AND each subscriber method in the class has a different configuration.
public abstract Subscribe.BatchingStrategy batchingStrategy
Subscribe.BatchingStrategy.None, the argument to the subscriber method must be an Iterable.
Event batches does not support removal.
public abstract int batchAge
Subscribe.BatchingStrategy.Age or Subscribe.BatchingStrategy.SizeOrAge
public abstract int batchSize
Subscribe.BatchingStrategy.SizeOrAge
public abstract int queueSize
public abstract boolean syncIfAllowed
SyncSubscribersGatekeeper.ALLOW_SYNC_SUBSCRIBERS, which when set to true, allows registration of synchronous consumers. SyncSubscribersGatekeeper.ALLOW_SYNC_SUBSCRIBERS is set to true at the time of event publishing.
If the property is set to false the events will be sent to the consumer asynchronously.
true if this subscriber favors synchronous consumption of events. false by
default.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||