Event Routing
A routing schema used to deliver events.
A routing schema consists of a default route and custom routes per event class. When calculating a set of event targets, EventRouting
will see if there is a custom route set for the type of the event. If not found, the default route will be applied.
Parameters
<I>
the type of the entity IDs to which events are routed
Functions
Link copied to clipboard
Obtains the default route used by the schema.
Link copied to clipboard
Sets new default route in the schema.
Link copied to clipboard
public EventRouting<I> route<E extends EventMessage>(Class<E> eventType, EventRoute<I, ? extends Object> via)
Sets a custom route for the passed event type.
Link copied to clipboard
Sets a custom routing schema for entity state updates.
Link copied to clipboard
public EventRouting<I> unicast<E extends EventMessage>(Class<E> eventType, BiFunction<E, EventContext, I> via)
Sets a custom route for the passed event type by obtaining the target entity ID from the passed function over event message and its context.
Sets a custom route for the passed event type by obtaining the target entity ID from the passed function.
Link copied to clipboard
Creates a new event routing with the passed default route.
Link copied to clipboard
Creates a new event routing with the default one by event producer ID.
Inherited functions
Link copied to clipboard
Creates an event route that obtains event producer ID from an
EventContext
and returns it as a sole element of the immutable set.Link copied to clipboard
Creates an event route that obtains event producer ID from an
EventContext
and returns it as a sole element of the immutable set.