Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9229571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:36:17+00:00 2026-06-18T05:36:17+00:00

I have a publish-subscribe use case where I would like to block on the

  • 0

I have a publish-subscribe use case where I would like to block on the publish side until each of the subscribers confirm that they have completed handling the message sent by the publisher.

I (incorrectly?) assumed that I could use RabbitMQ and its Java amqp-client’s Channel.waitForConfirmsOrDie method as part of my solution. The issue is that I haven’t found a case in which waitForConfirmsOrDie will actually block.

According to the javadocs, waitForConfirmsOrDie is supposed to:

Wait until all messages published since the last call have been either ack’d or nack’d by the broker. If any of the messages were nack’d, waitForConfirmsOrDie will throw an IOException. When called on a non-Confirm channel, it will return immediately.

In order to test that this method really works, I started with this example code from the RabbitMQ website.

The example code creates a publisher and a consumer, each on its own separate thread. Then the publisher sends messages to the exchange while the consumer consumes the messages. It seems that the publisher is supposed to block until all of the messages are ack’d via its call to waitForConfirmsOrDie().

This example code seemed like it matched up perfectly with what I was trying to do. But, it doesn’t seem to work the way I thought it did. In fact, if, in the consumer thread, I turn off auto-acking messages, then waitForConfirmsOrDie() still returns immediately.

I turned off auto ack by just changing one false to true:
ch.queueDeclare(QUEUE_NAME, false, false, false, null);
becomes
ch.queueDeclare(QUEUE_NAME, true, false, false, null); (2nd arg false instead of true). I believe this means that acks should no longer be sent by the consumer.

So what does waitForConfirmsOrDie() actually do? When would it block?

If waitForConfirmsOrDie doesn’t do what I want, is there a way to make a publisher wait until all subscribers ack a message before proceeding?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:36:18+00:00Added an answer on June 18, 2026 at 5:36 am

    As far as I understand those calls are not supposed to wait for confirmation from consumer. The purpose of waitForConfirms* methods is making sure your message was delivered to broker and to provide basic delivered/failed type of notification. In other words, message will not disappear without notifying produces in case if one of rmq nodes (or even all of nodes) failed/unavailable.

    You can see this exception in action if you disconnect or turn off rmq before basicPublish call.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a c++ console application which I would like to publish using clickonce.
I have to create a publish-subscribe silverlight application. and the class that publishes the
I got an android application that I would like to send its use log
Is there any library for distributed in-memory cache, distributed tasks, publish/subscribe messaging? I have
I have a list of categories that I publish to a UI from database.
I have made a small log service that i want to publish to a
I have a simple WCF publish/subscribe up and running, based on this example .
I have a publish/subscribe scenario in WCF using net.tcp and Duplex callbacks. I have
The way it was explained was through the use of events and the publish/subscribe
I need to use the publish subscribe service of Strophe to access nodes my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.