Hello all,
For some days I am fighting to have my setup to work. I want to try out a configuration without Spring.
I have a very simple setup with JPA event store and it seems to work since the error I am facing is not what my test says:
My fixtureConfiguration test works as expected
fixture
.given()
.when(new CreateEmployee(new EmployeeId("1234"), "John", "Constantine", LocalDate.now()))
.expectSuccessfulHandlerExecution()
.expectEvents(
new EmployeeCreated(new EmployeeId("1234"), "John", "Constantine", LocalDate.now()));
But when I ran it locally I got the following error:
Resulted in: org.jboss.resteasy.spi.UnhandledException: org.axonframework.commandhandling.NoHandlerForCommandException: No handler was subscribed to command [com.acme.poc.hr.command.application.employee.commands.CreateEmployee]
My config so far:
@Produces
public EventStorageEngine eventStorageEngine() {
return JpaEventStorageEngine.builder()
.entityManagerProvider(entityManagerProvider)
.eventSerializer(JacksonSerializer.defaultSerializer())
.build();
}
@Produces
public Configuration axonConfiguration() {
return DefaultConfigurer.defaultConfiguration()
.configureCommandBus(
config ->
AsynchronousCommandBus.builder()
.transactionManager(NoTransactionManager.INSTANCE)
.messageMonitor(
config.messageMonitor(AsynchronousCommandBus.class, "commandBus"))
.build())
.configureEventStore(
conf -> EmbeddedEventStore.builder().storageEngine(eventStorageEngine()).build())
.start();
}
I didn’t find any code sample with a complete config for non-spring or non-AxonServer projects, someone face the same or is trying something similar?