How does publisher get confirmation of message delivery to consumer

728 views
Skip to first unread message

pooja khambhayata

unread,
Dec 18, 2016, 4:47:31 PM12/18/16
to rabbitmq-users
Hello ,

I am new to rabbit mq.. and I have two different apps connected with rabbit mq. One with java and other with node js. Node js app is a publisher and java app is a consumer. 8 would like to know if a publisher can get acknowledged if the consumer received message successfully .

Currently if my receiver app is down then publisher app keeps on waiting for ever for message to be received

Michael Klishin

unread,
Dec 18, 2016, 5:25:37 PM12/18/16
to rabbitm...@googlegroups.com, pooja khambhayata
See tutorial 6 on http://www.rabbitmq.com/getstarted.html and  http://www.rabbitmq.com/confirms.html.
Publishers are unaware of consumers unless consumers notify them.
> --
> You received this message because you are subscribed to the Google Groups "rabbitmq-users"
> group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
> To post to this group, send an email to rabbitm...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

--
MK

Staff Software Engineer, Pivotal/RabbitMQ


Michael Klishin

unread,
Dec 23, 2016, 11:54:20 AM12/23/16
to pooja khambhayata, rabbitm...@googlegroups.com
+rabbitmq-users. I do not offer 1-on-1 support of any kind.

Publishers are unaware of deliveries to consumers. See http://rabbitmq.com/confirms.html.

On Fri, Dec 23, 2016 at 7:36 PM, pooja khambhayata <pooja.kh...@gmail.com> wrote:
thank you for the response. that helped and I went through the links to implement below:

I created a channel using, 
amqpConn.createConfirmChannel(function(err, ch) {

and for publishing I am doing as below. when rabbitMQ server is up and consumer app is up, i see both the prints highlighted in bold. "Message confirmed" and "Message delivered to Receiver App". But when I shutdown the Receiver App, I still get both the prints. 
I was expecting one of the prints to miss since my Receiver App did not acknowledge and it was down. I also see the queue on rabbitMQ server has messages sitting there yet to be consumed.  Please help on this? Thanks in advance. 

pubChannel.publish(exchange, msgType, content, reqq, function(err, ok) {
if (err !=null) {
console.log(cName," Error while publish", err);
}
else{
console.log("Message confirmed");
}
});
pubChannel.waitForConfirms(function(err){
       if(err !=null){
         console.error('ERR',err);
       }
       else{
         console.log('Message delivered to Receiver App');
       }
     });


Best,
Pooja


On Sun, Dec 18, 2016 at 5:25 PM, Michael Klishin <mkli...@pivotal.io> wrote:
See tutorial 6 on http://www.rabbitmq.com/getstarted.html and  http://www.rabbitmq.com/confirms.html.
Publishers are unaware of consumers unless consumers notify them.

On 19 December 2016 at 00:47:35, pooja khambhayata (pooja.kh...@gmail.com) wrote:
> Hello ,
>
> I am new to rabbit mq.. and I have two different apps connected with rabbit mq. One with
> java and other with node js. Node js app is a publisher and java app is a consumer. 8 would
> like to know if a publisher can get acknowledged if the consumer received message successfully
> .
>
> Currently if my receiver app is down then publisher app keeps on waiting for ever for message
> to be received
>
> --
> You received this message because you are subscribed to the Google Groups "rabbitmq-users"
> group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.

> To post to this group, send an email to rabbitm...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

--
MK

Staff Software Engineer, Pivotal/RabbitMQ


pooja khambhayata

unread,
Dec 23, 2016, 5:00:41 PM12/23/16
to rabbitm...@googlegroups.com
thank you for the response. that helped and I went through the links to implement below:

I created a channel using, 
amqpConn.createConfirmChannel(function(err, ch) {

and for publishing I am doing as below. when rabbitMQ server is up and consumer app is up, i see both the prints highlighted in bold. "Message confirmed" and "Message delivered to Receiver App". But when I shutdown the Receiver App, I still get both the prints. 
I was expecting one of the prints to miss since my Receiver App did not acknowledge and it was down. I also see the queue on rabbitMQ server has messages sitting there yet to be consumed.  Please help on this? Thanks in advance. 

pubChannel.publish(exchange, msgType, content, reqq, function(err, ok) {
if (err !=null) {
console.log(cName," Error while publish", err);
}
else{
console.log("Message confirmed");
}
});
pubChannel.waitForConfirms(function(err){
        if(err !=null){
          console.error('ERR',err);
        }
        else{
          console.log('Message delivered to Receiver App');
        }
      });



Best,
Pooja



--
You received this message because you are subscribed to a topic in the Google Groups "rabbitmq-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rabbitmq-users/MwMcg8PKR_I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send an email to rabbitmq-users@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages