<html><head><base href="x-msg://242/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Then adjusting the prefetch(part of basic.qos) is probably what you want. If you set the prefetch to 1, and subscribe with ack's turned on, then you will only get the next message after you ack the previous one.</div><div><br></div><div>Hopefully that works for you. Again, I'm not sure what the .net way to specify that is though.</div><div><br></div><div>Scott</div><br><div><div>On 2009-11-16, at 10:42 PM, JD Conley wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div><div style="font-family: 'Times New Roman'; font-size: 12pt; color: rgb(0, 0, 0); ">Thanks Scott. But I do want to subscribe/consume (I think), as it is unknown whether there will be any data in the queue, and I want to be notified immediately when there is. I don't really want to poll rabbit using a basic.get and would rather be notified asynchronously when new items are in the queue. I have hundreds (thousands soon) of queues waiting for data across a cluster and the polling overhead would be higher than I want it to be.<div><br></div><div>-JD<div><br>----- Original Message -----<br>From: "Scott Brooks" <<a href="mailto:scott.brooks@epicadvertising.com">scott.brooks@epicadvertising.com</a>><br>To: "JD Conley" <<a href="mailto:jdc@hive7.com">jdc@hive7.com</a>><br>Cc:<span class="Apple-converted-space"> </span><a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>Sent: Monday, November 16, 2009 6:59:35 PM GMT -08:00 US/Canada Pacific<br>Subject: Re: [rabbitmq-discuss] how to consume one message at a time<br><br>I'm not sure what the .NET api looks like, but you want to do a basic get, rather then a basic subscribe.<br><br>It will return a single message from the queue, and then when you call it again, you will get the next message(or null/something similar)<br><br>Scott<br><br>On 2009-11-16, at 5:41 PM, JD Conley wrote:<br><br>> I'm using the .NET client and can't figure out how to consume only one<br>> message at a time. Basically I would like to simply:<br>><span class="Apple-converted-space"> </span><br>> 1. Consume one message from a queue<br>> 2. Cancel consumption so I don't lose any messages<br>><span class="Apple-converted-space"> </span><br>> My confusion comes with the statement in the user guide that "Application<br>> callback handlers must not invoke blocking AMQP operations (such as<br>> IModel.QueueDeclare or IModel.BasicCancel). If they do, the channel will<br>> deadlock." But, a BasicCancel is precisely what I want to do in the<br>> callback.<br>><span class="Apple-converted-space"> </span><br>> I want to use the EventingBasicConsumer. What would be the best way to<br>> accomplish this? Which options do I set?<span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>> -JD<br>><span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>> _______________________________________________<br>> rabbitmq-discuss mailing list<br>><span class="Apple-converted-space"> </span><a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>><span class="Apple-converted-space"> </span><a href="http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss">http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br><br></div></div></div></div></span></blockquote></div><br></body></html>