Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

189
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda