Prev Next

Integration / ActiveMQ Interview Questions Basics

List the message acknowledgment modes in ActiveMQ?

JMS sessions in ActiveMQ support four acknowledgment modes:

  • AUTO_ACKNOWLEDGE - acknowledged automatically right after the message is received.
  • CLIENT_ACKNOWLEDGE - the client explicitly calls acknowledge().
  • DUPS_OK_ACKNOWLEDGE - lazy acknowledgment that tolerates occasional duplicates for better throughput.
  • SESSION_TRANSACTED - acknowledgment is tied to a transaction commit.

Choosing between them is a throughput-versus-safety trade-off: AUTO_ACKNOWLEDGE and DUPS_OK_ACKNOWLEDGE are simplest and fastest but riskier if processing fails after the message is already considered handled, while CLIENT_ACKNOWLEDGE and SESSION_TRANSACTED give the application explicit control over exactly when a message is considered done, at the cost of a little extra code.

Which mode acknowledges automatically right after receive() returns?
Which mode lets the consumer decide exactly when to acknowledge?

More Related questions...

Show more question and Answers...



Get latest updates by email

One email when a new topic is published. No spam. Unsubscribe any time.