I am using the RabbitMQ Java API.

Channel A does a basicGet, gets message M channel A is closed. AutoAck is
set to false.
Now I need to Ack message M using some other channel (channel B), and do not
want message M to be delivered to some other consumer in the meanwhile. What
can be the best approach to achieve this?

Abhishek Kona
Department of Computer Engineering
National Institute of Technology
Karnataka, India
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20100811/663de9d2/attachment.htm>

Search Discussions

  • Alexandru Scvorţov at Aug 11, 2010 at 9:32 am
    If you get a message and close the channel without ack'ing it, the
    message will get reinserted into the queue.

    If you don't want the message to be reinserted, either you acknowledge
    it explicitly, or you get with noAck set to true.

    Cheers,
    Alex
    On Wed, Aug 11, 2010 at 02:31:40PM +0530, Abhishek K wrote:
    I am using the RabbitMQ Java API.

    Channel A does a basicGet, gets message M channel A is closed. AutoAck is
    set to false.
    Now I need to Ack message M using some other channel (channel B), and do not
    want message M to be delivered to some other consumer in the meanwhile. What
    can be the best approach to achieve this?

    Abhishek Kona
    Department of Computer Engineering
    National Institute of Technology
    Karnataka, India
    _______________________________________________
    rabbitmq-discuss mailing list
    rabbitmq-discuss at lists.rabbitmq.com
    https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
  • Abhishek K at Aug 11, 2010 at 9:41 am
    In my situation
    I am using a thrift layer in the middle.
    RabbitMQ runs on Machine A, Thrift on Machine B and Client on Machine C.
    Thrift is the middle layer, which relays the message to the client.

    Now if I have to acknowledge the message I have to keep the channel object
    open at the Thrift layer, till the user acknowledges the message.
    What can be the best way to do this.

    Thanks
    Abhishek Kona


    On Wed, Aug 11, 2010 at 3:02 PM, Alexandru Scvor?ov
    wrote:
    If you get a message and close the channel without ack'ing it, the
    message will get reinserted into the queue.

    If you don't want the message to be reinserted, either you acknowledge
    it explicitly, or you get with noAck set to true.

    Cheers,
    Alex
    On Wed, Aug 11, 2010 at 02:31:40PM +0530, Abhishek K wrote:
    I am using the RabbitMQ Java API.

    Channel A does a basicGet, gets message M channel A is closed. AutoAck is
    set to false.
    Now I need to Ack message M using some other channel (channel B), and do not
    want message M to be delivered to some other consumer in the meanwhile. What
    can be the best approach to achieve this?

    Abhishek Kona
    Department of Computer Engineering
    National Institute of Technology
    Karnataka, India
    _______________________________________________
    rabbitmq-discuss mailing list
    rabbitmq-discuss at lists.rabbitmq.com
    https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20100811/cc21f598/attachment-0001.htm>
  • Alexandru Scvorţov at Aug 11, 2010 at 10:30 am
    I'm not familiar with Thrift, so I cannot really answer.

    A simple solution would be to basic.get with noAck set to true. That
    way, messages will be not need to be acknowledged (so they won't get
    redelivered).

    If you really need the client to be the one ack'ing the message (perhaps
    because you sometimes do want the message to be redelivered), I think
    you'll have to short-circuit Thrift.

    Cheers,
    Alex
    On Wed, Aug 11, 2010 at 03:11:14PM +0530, Abhishek K wrote:
    In my situation
    I am using a thrift layer in the middle.
    RabbitMQ runs on Machine A, Thrift on Machine B and Client on Machine C.
    Thrift is the middle layer, which relays the message to the client.

    Now if I have to acknowledge the message I have to keep the channel object
    open at the Thrift layer, till the user acknowledges the message.
    What can be the best way to do this.

    Thanks
    Abhishek Kona


    On Wed, Aug 11, 2010 at 3:02 PM, Alexandru Scvor?ov
    wrote:
    If you get a message and close the channel without ack'ing it, the
    message will get reinserted into the queue.

    If you don't want the message to be reinserted, either you acknowledge
    it explicitly, or you get with noAck set to true.

    Cheers,
    Alex
    On Wed, Aug 11, 2010 at 02:31:40PM +0530, Abhishek K wrote:
    I am using the RabbitMQ Java API.

    Channel A does a basicGet, gets message M channel A is closed. AutoAck is
    set to false.
    Now I need to Ack message M using some other channel (channel B), and do not
    want message M to be delivered to some other consumer in the meanwhile. What
    can be the best approach to achieve this?

    Abhishek Kona
    Department of Computer Engineering
    National Institute of Technology
    Karnataka, India
    _______________________________________________
    rabbitmq-discuss mailing list
    rabbitmq-discuss at lists.rabbitmq.com
    https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
  • Alexandru Scvorţov at Aug 11, 2010 at 11:12 am
    Hi Vivek,
    So, I have my RabbitMQ running on machine A, and I give a API to Consumers
    who are operating on machine C. So, the user just calls a get method without
    knowing the details of RabbitMQ. My API, which apparently runs on Machine B,
    does all the back side job of opening a channel and getting the message.

    Is there a way I can implement acknowledgment?

    It appears to me that if I retrieved a message M through channel C, I have
    to acknowledge message M through Channel C only. So does my API needs to
    keep the channel open till the user gives back an acknowledgment? Or is
    there a better ( and cleaner ? ) way out?
    The way AMQP works is that it re-enqueues unack'd messages on channel
    close. If you close the channel, there's no point in ack'ing the
    messages; they're already on some queue waiting to be delivered to some
    consumer (possibly, the same one).

    What you could do, is auto-ack the messages when the middle layer gets
    them. Then, if a client says it doesn't want the message (the
    equivalent of not sending an ack), the middle layer republishes the
    message. This may not be possible in your setup and will cause all
    sorts of other problems.

    Cheers,
    Alex

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprabbitmq-discuss @
categoriesrabbitmq
postedAug 11, '10 at 9:01a
activeAug 11, '10 at 11:12a
posts5
users2
websiterabbitmq.com
irc#rabbitmq

2 users in discussion

Alexandru Scvorţov: 3 posts Abhishek K: 2 posts

People

Translate

site design / logo © 2022 Grokbase