on-internet
← Community

JPA save inside rabbitmq listener

Stack Overflow ·

I am trying to save an entity consumed inside a queue using rabbit mq. I have encountered some problems. First of all : The consumed event will give me an entity which already has an id. My user entity has an automatic generation ID annotation on UUID id attribute. How should I approach this? For example I know I could implement Persistable interface, but won't this have compatibility issues with the already implemented methods which depend on that automatic id generation? Second: How do you check correctly if the toPersist entity was actually saved in db ? I used a try catch but I found out I

Comments

Sign in or sign up to comment and upvote.

No comments yet.