@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface Subscribe
EventBus must annotate their consumer methods with this annotation. SyncSubscribersGatekeeper.ALLOW_SYNC_SUBSCRIBERS to true.| Modifier and Type | Optional Element and Description |
|---|---|
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.SizeOrAgepublic abstract int batchSize
Subscribe.BatchingStrategy.SizeOrAgepublic 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.