setupImportRouting

protected void setupImportRouting(EventRouting<I> routing)

A callback for derived classes to customize routing schema for importable events.

The default routing uses producer ID of the event as the ID of the target aggregate.

This default routing requires that Event instances post posted} for import must contain the ID of the target aggregate. Not providing a valid aggregate ID would result in RuntimeException.

Some aggregates may produce events with the aggregate ID as the first field of an event message. To set the default routing for repositories of such aggregates, please use the code below:


routing.replaceDefault(EventRoute.byFirstMessageField(SomeId.class));

Parameters

routing

the routing schema to customize.