Ask questions and see you at August, 3rd, 8.PM. CET: https://vimeo.com/event/154379
Also checkout recent episode:
Please keep the questions Jakarta EE-stic. Means: as short and as concise as only possible. Feel free to ask several, shorter questions.
Upcoming airhacks.tv events are also going to be announced at meetup.com/airhacks
Hello Adam, asking here because i don't find 78th Q&A gist.
I'm experimenting/learning Microservices with Java (Quarkus in this case). I have one boundary resource where clients use to create something. I want to do like this: After client calls resource, I want to commit the entity in database first with status of AWAITING_ACCEPTANCE, and return to client with message that he now can track status of entity in /resources/get/id. After persisting to database with status AWAITING_ACCEPTANCE, I want to publish message to Kafka topic and let my other microservice subscribe to that message and so on...
I have one @transactional class with method like this
create(TheEntity en) {
en.persist(); // using quarkus panache
kafka.publish();
}
Is it safe to do like this?
Can it happen that even after en.persist(), maybe JPA not catch any eventual error in database? And if it doesn't catch, in that case I am publishing now non-reliable message to topic? And the whole entity now across microservices is non-reliable...
Is the @PostPersist callback really called after entity has been successfully written to database. Can it happen any error in database itself, and even in that case the callback @PostPersist is fired??
How to publish message to topic after fully success entity is written to database?
--Thanks