I have wired my Axon app using Spring Boot annotations.
I use JPA for event store persistence.
Getting JPA to work with Axon took some experimentation, and while it appears to work OK, I may have got something wrong...
I now need to have a Java 8 file Watcher looking for a file to be dropped for ingest. My plan is to use that file to ingest json serialized commands.
My main application uses SpringMVC restul endpoints, each declaring an @Transaction boundary.
I create the new file watcher in a thread managed by a ThreadPoolTaskExecutor.
The watcher wakes up when the file appears, reads it, deserializes commands OK, and then I send a command at a time into the CommandGateway autowired into my watcher thread.
The command goes into the command bus - fine.
The events get fired etc - all fine.
Until it gets to the JPA event store, and I get an exception :
javax.persistence.TransactionRequiredException : No transactional EntityManager available