Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

190
Views
spring jms rollback event from queue

I have a scenario where we use spring jms to post events to queue and update status in database but sometimes posting to end queue is success but updating status to database is failed so in this particular scenario the events posted to queue should be rolled back as updating to database is failed,so posting to queue is in another framework and updating to database is another framework so we cant put the event posting to queue and database update at same place we used currently JMSTEMPLATE.EXECUTE(new ProducerCallback{}) to post in queue.

I am aware of when execution reaches end of JMSTEMPLATE.EXECUTE(new ProducerCallback{}) method it will commit but my database updation logic is outside the JMSTEMPLATE.EXECUTE(new ProducerCallback{}) method so I want to control the event posting to queue based on the successful insertion in to database that means if insertion of success response fails events posted to queue should be rolled back.

Can any one help me out to figure out how to achieve this scenario.

Thanks in advance.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You need to perform the database update within the doInJms() method too. If an exception is thrown, the JMS updates will roll back.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!