0

How could I achieve a transactional read (i.e. reading a JMS message as part of a transaction using MessageConsumer.receiveNoWait() and if the transaction fails the message should remain in the queue) ?

I'm thinking of using JmsXA connectionFactory and XA connections.

Thank you

Sergiu
  • 2,502
  • 6
  • 35
  • 57

1 Answers1

1

Message redelivery is sending message back to queue which fails during the processing.

Its possible using the transactional read which can be defined differently e.g. - Transacted Sessions - Message Driven Bean ( can be at container level and configuration based)

Message acknowledgement happens on the session level, if you commit session it will save the read and on rollback message/bunch of unacknowledged messages will be given back to the queue (@ Broker). For details please go through the http://www.javaworld.com/javaworld/jw-02-2002/jw-0315-jms.html.

neo
  • 1,054
  • 1
  • 10
  • 19