Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

141
Vistas
JmsTemplate batch issue

my current use case is in my listener it will:

  1. Consume an event(let's call it original event) from queue, this event includes list of replay events(let's call it sub events).
  2. Produce those replay events (sub events) in a batch to other queue.
  3. Update Cassandra.

I can produce all the replay events based on what Gary mention, and rollback all the replay events if any exceptions happen during produce.

Use one of the execute methods with a ProducerCallback...

SessionCallback and ProducerCallback

Then, in your ProducerCallback.doInJms() method...

Use the producer to send multiple messages. When the callback exits, the transaction will be committed.

However, if there are any exception happen in step 3 we can only rollback the original event but not those replay events, since in step 2 we already committed those replay events after the callback exits and those replay events already in another queue and cannot be rollback.

Does someone has any better idea about how we can rollback everything if step 3 has exception?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You have to do everything within the same session; consume, produce..., cassandra.

All inside doInJms()...

  • session.createConsumer()

try {

  • consumer.receive()
  • producer send() ...
  • cassandra update

finally {

  • consumer.close()

}

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda