Thank you.
Using the Configuration API is indeed very effective.
The downside of having everything handed to you in Spring Boot autoconfiguration, is that you as a developer don’t learn to use it - but you’ll probably need it anyway for testing.
So learning the configuration API is recommended to everyone who reads along.
As a community service here is a complete example of how to configure a event sourced aggregate, a read model and a command gateway.
EventHandlingConfiguration eventhandlers = new EventHandlingConfiguration()
.configureListenerInvocationErrorHandler(c -> PropagatingErrorHandler.instance())
.registerEventHandler(c -> myReadModel)
Configuration config = DefaultConfigurer.defaultConfiguration()
.configureEmbeddedEventStore(c -> new InMemoryEventStorageEngine())
.configureAggregate(MyAggregate.class)
.registerModule(eventhandlers)
.registerComponent(MyService.class, c -> new MyServiceStub())
.buildConfiguration();
config.start();
final CommandGatewayFactory factory = new CommandGatewayFactory(config.commandBus());
MyCommandGateway gw = factory.createGatewayMyCommandGateway.class);