SPEC - The DispatcherComponentSpec subclassTARGET - The type that this spec will createpublic abstract class EventRoutingComponentSpec<SPEC extends EventRoutingComponentSpec<SPEC,TARGET>,TARGET> extends DispatcherComponentSpec<SPEC,TARGET>
Environment,
Dispatcher, and Router.| Modifier and Type | Class and Description |
|---|---|
protected static class |
EventRoutingComponentSpec.EventRoutingStrategy |
| Constructor and Description |
|---|
EventRoutingComponentSpec() |
| Modifier and Type | Method and Description |
|---|---|
SPEC |
broadcastEventRouting()
Configures the component's EventRouter to broadcast events to all matching consumers
|
protected TARGET |
configure(reactor.core.Dispatcher dispatcher,
reactor.Environment environment) |
protected abstract TARGET |
configure(EventBus reactor,
reactor.Environment environment) |
SPEC |
consumerNotFoundHandler(reactor.fn.Consumer<java.lang.Object> consumerNotFoundHandler)
Configures the callback to invoke if a notification key is sent into this component and there are no consumers
registered to respond to it.
|
SPEC |
consumerRegistry(Registry<reactor.fn.Consumer<? extends Event<?>>> consumerRegistry)
Configures the
Registry to use when creating this component. |
SPEC |
dispatchErrorHandler(reactor.fn.Consumer<java.lang.Throwable> dispatchErrorHandler)
Configures the component's error handler for any errors occurring during dispatch (e.g.
|
SPEC |
eventFilter(Filter filter)
Assigns the component's Filter
|
SPEC |
eventRouter(Router router)
Assigns the component's EventRouter
|
SPEC |
firstEventRouting()
Configures the component's EventRouter to route events to the first of the matching consumers
|
SPEC |
randomEventRouting()
Configures the component's EventRouter to route events to one consumer that's randomly selected from that matching
consumers
|
SPEC |
roundRobinEventRouting()
Configures the component's EventRouter to route events to one consumer selected from the matching consumers using a
round-robin algorithm consumers
|
SPEC |
traceEventPath()
Configures this component to provide event tracing when dispatching and routing an event.
|
SPEC |
traceEventPath(boolean b)
Configures this component to provide or not provide event tracing when dispatching and routing an event.
|
SPEC |
uncaughtErrorHandler(reactor.fn.Consumer<java.lang.Throwable> uncaughtErrorHandler)
Configures the component's uncaught error handler for any errors that get reported into this component but aren't a
direct result of dispatching (e.g.
|
defaultDispatcher, dispatcher, dispatcher, env, get, synchronousDispatcherpublic final SPEC eventFilter(Filter filter)
thispublic final SPEC eventRouter(Router router)
thispublic final SPEC broadcastEventRouting()
thispublic final SPEC randomEventRouting()
thispublic final SPEC firstEventRouting()
thispublic final SPEC roundRobinEventRouting()
thispublic SPEC dispatchErrorHandler(reactor.fn.Consumer<java.lang.Throwable> dispatchErrorHandler)
Consumer#accept method.dispatchErrorHandler - the error handler for dispatching errorsthispublic SPEC uncaughtErrorHandler(reactor.fn.Consumer<java.lang.Throwable> uncaughtErrorHandler)
uncaughtErrorHandler - the error handler for uncaught errorsthispublic final SPEC traceEventPath()
thispublic final SPEC traceEventPath(boolean b)
b - whether to trace the event path or notthispublic SPEC consumerRegistry(Registry<reactor.fn.Consumer<? extends Event<?>>> consumerRegistry)
Registry to use when creating this component. Registries can be
shared to reduce GC pressure and potentially be persisted across restarts.consumerRegistry - the consumer registry to usethispublic SPEC consumerNotFoundHandler(reactor.fn.Consumer<java.lang.Object> consumerNotFoundHandler)
consumerNotFoundHandler - the not found handler to usethisprotected final TARGET configure(reactor.core.Dispatcher dispatcher, reactor.Environment environment)
configure in class DispatcherComponentSpec<SPEC extends EventRoutingComponentSpec<SPEC,TARGET>,TARGET>