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 EventRouter.| 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(Dispatcher dispatcher,
Environment environment) |
protected abstract TARGET |
configure(Reactor reactor,
Environment environment) |
SPEC |
consumerInvoker(ConsumerInvoker consumerInvoker)
Assigns the component's Consumer Invoker
|
SPEC |
consumerNotFoundHandler(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<Consumer<? extends Event<?>>> consumerRegistry)
Configures the
Registry to use when creating this component. |
SPEC |
converters(Converter... converters)
Configures the component's EventRouter to use the given {code converters}.
|
SPEC |
converters(java.util.List<Converter> converters)
Configures the component's EventRouter to use the given {code converters}.
|
SPEC |
dispatchErrorHandler(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(EventRouter 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(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.
|
actorSystem, actorSystem, defaultDispatcher, dispatcher, dispatcher, env, get, synchronousDispatcherpublic final SPEC converters(Converter... converters)
converters - The converters to be used by the event routerthispublic final SPEC converters(java.util.List<Converter> converters)
converters - The converters to be used by the event routerthispublic final SPEC eventFilter(Filter filter)
thispublic final SPEC consumerInvoker(ConsumerInvoker consumerInvoker)
thispublic final SPEC eventRouter(EventRouter router)
thispublic final SPEC broadcastEventRouting()
thispublic final SPEC randomEventRouting()
thispublic final SPEC firstEventRouting()
thispublic final SPEC roundRobinEventRouting()
thispublic SPEC dispatchErrorHandler(Consumer<java.lang.Throwable> dispatchErrorHandler)
Consumer#accept method.dispatchErrorHandler - the error handler for dispatching errorsthispublic SPEC uncaughtErrorHandler(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<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(Consumer<java.lang.Object> consumerNotFoundHandler)
consumerNotFoundHandler - the not found handler to usethisprotected abstract TARGET configure(Reactor reactor, Environment environment)
protected final TARGET configure(Dispatcher dispatcher, Environment environment)
configure in class DispatcherComponentSpec<SPEC extends EventRoutingComponentSpec<SPEC,TARGET>,TARGET>