I have a Spring Boot micro-service which has an endpoint to delete the entry from a table. I am using Spring Data JPA to perform this. It works fine when I call the api, HTTP request sent and JPA repository deletes the data. OSIV is enabled which automatically register an EntityManager, creates database connection and make sure it is available throughout the lifespan of web request.
I have a Redis message subscriber provided by Spring Redis in the same application which listen the event and calls the same JPA repository to delete the data from table. I noticed no delete/update/insert are being performed by JPA repository when called from subscriber. I understand there is an issue with transaction which is not being created in this flow. I tried with @Transactional but it is still failing as transaction is missing.
Please help me if Redis Message Container requires some other configuration to enable transaction for JPA repository.