<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<STYLE>
BLOCKQUOTE {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em
}
OL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
UL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
BODY {
        LINE-HEIGHT: 1.5; FONT-FAMILY: 宋体; COLOR: #000080; FONT-SIZE: 10.5pt
}
</STYLE>
<META name=GENERATOR content="MSHTML 8.00.7601.17874"></HEAD>
<BODY style="MARGIN: 10px">
<DIV>Hi Matthias,</DIV>
<DIV> </DIV>
<DIV>Now I am clear about it. So for my scenario, using the token queue is the
better solution. I have tried it and it works fine.</DIV>
<DIV> </DIV>
<DIV>Best Regards</DIV>
<DIV> </DIV>
<HR style="WIDTH: 210px; HEIGHT: 1px" align=left color=#b5c4df SIZE=1>
<DIV><SPAN>johnson</SPAN></DIV>
<DIV> </DIV>
<DIV
style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0cm; PADDING-LEFT: 0cm; PADDING-RIGHT: 0cm; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<DIV
style="PADDING-BOTTOM: 8px; PADDING-LEFT: 8px; PADDING-RIGHT: 8px; BACKGROUND: #efefef; COLOR: #000000; FONT-SIZE: 12px; PADDING-TOP: 8px">
<DIV><B>From:</B> <A href="mailto:matthias@rabbitmq.com">Matthias
Radestock</A></DIV>
<DIV><B>Date:</B> 2012-09-05 22:14</DIV>
<DIV><B>To:</B> <A href="mailto:johnson@edocom.cn">johnson</A></DIV>
<DIV><B>CC:</B> <A
href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss</A></DIV>
<DIV><B>Subject:</B> Re: [rabbitmq-discuss] How to achieve HA
consumers?</DIV></DIV></DIV>
<DIV>
<DIV>Johnson,</DIV>
<DIV> </DIV>
<DIV>On 05/09/12 14:51, johnson wrote:</DIV>
<DIV>> The message-count is correct but the consumer-count is changed from 1</DIV>
<DIV>> to 0. I don't know why.</DIV>
<DIV> </DIV>
<DIV>That is due to a subtlety in the meaning of consumer-count in the AMQP </DIV>
<DIV>spec. From </DIV>
<DIV>http://www.rabbitmq.com/amqp-0-9-1-reference.html#queue.declare-ok.consumer-count</DIV>
<DIV><quote></DIV>
<DIV>Reports the number of *active* consumers for the queue.</DIV>
<DIV></quote></DIV>
<DIV> </DIV>
<DIV>Rabbit's interpretation of "active consumer" is "a consumer to which a </DIV>
<DIV>message can be sent". Since your consumer channels have a qos prefetch </DIV>
<DIV>count of 1, once a message has been sent to a consumer no further </DIV>
<DIV>messages can be sent to it until it acks the message. Until then the </DIV>
<DIV>consumer is inactive and hence won't be included in the consumer-count </DIV>
<DIV>returned by queue.declare-ok.</DIV>
<DIV> </DIV>
<DIV>The RabbitMQ management API/UI isn't bound by AMQP semantics, so it </DIV>
<DIV>always reports all consumers, active or not.</DIV>
<DIV> </DIV>
<DIV>Regards,</DIV>
<DIV> </DIV>
<DIV>Matthias.</DIV>
<DIV> </DIV></DIV></BODY></HTML>