<!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>&nbsp;</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>&nbsp;</DIV>
<DIV>Best Regards</DIV>
<DIV>&nbsp;</DIV>
<HR style="WIDTH: 210px; HEIGHT: 1px" align=left color=#b5c4df SIZE=1>

<DIV><SPAN>johnson</SPAN></DIV>
<DIV>&nbsp;</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>&nbsp;<A href="mailto:matthias@rabbitmq.com">Matthias 
Radestock</A></DIV>
<DIV><B>Date:</B>&nbsp;2012-09-05&nbsp;22:14</DIV>
<DIV><B>To:</B>&nbsp;<A href="mailto:johnson@edocom.cn">johnson</A></DIV>
<DIV><B>CC:</B>&nbsp;<A 
href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss</A></DIV>
<DIV><B>Subject:</B>&nbsp;Re: [rabbitmq-discuss] How to achieve HA 
consumers?</DIV></DIV></DIV>
<DIV>
<DIV>Johnson,</DIV>
<DIV>&nbsp;</DIV>
<DIV>On&nbsp;05/09/12&nbsp;14:51,&nbsp;johnson&nbsp;wrote:</DIV>
<DIV>&gt;&nbsp;The&nbsp;message-count&nbsp;is&nbsp;correct&nbsp;but&nbsp;the&nbsp;consumer-count&nbsp;is&nbsp;changed&nbsp;from&nbsp;1</DIV>
<DIV>&gt;&nbsp;to&nbsp;0.&nbsp;I&nbsp;don't&nbsp;know&nbsp;why.</DIV>
<DIV>&nbsp;</DIV>
<DIV>That&nbsp;is&nbsp;due&nbsp;to&nbsp;a&nbsp;subtlety&nbsp;in&nbsp;the&nbsp;meaning&nbsp;of&nbsp;consumer-count&nbsp;in&nbsp;the&nbsp;AMQP&nbsp;</DIV>
<DIV>spec.&nbsp;From&nbsp;</DIV>
<DIV>http://www.rabbitmq.com/amqp-0-9-1-reference.html#queue.declare-ok.consumer-count</DIV>
<DIV>&lt;quote&gt;</DIV>
<DIV>Reports&nbsp;the&nbsp;number&nbsp;of&nbsp;*active*&nbsp;consumers&nbsp;for&nbsp;the&nbsp;queue.</DIV>
<DIV>&lt;/quote&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Rabbit's&nbsp;interpretation&nbsp;of&nbsp;"active&nbsp;consumer"&nbsp;is&nbsp;"a&nbsp;consumer&nbsp;to&nbsp;which&nbsp;a&nbsp;</DIV>
<DIV>message&nbsp;can&nbsp;be&nbsp;sent".&nbsp;Since&nbsp;your&nbsp;consumer&nbsp;channels&nbsp;have&nbsp;a&nbsp;qos&nbsp;prefetch&nbsp;</DIV>
<DIV>count&nbsp;of&nbsp;1,&nbsp;once&nbsp;a&nbsp;message&nbsp;has&nbsp;been&nbsp;sent&nbsp;to&nbsp;a&nbsp;consumer&nbsp;no&nbsp;further&nbsp;</DIV>
<DIV>messages&nbsp;can&nbsp;be&nbsp;sent&nbsp;to&nbsp;it&nbsp;until&nbsp;it&nbsp;acks&nbsp;the&nbsp;message.&nbsp;Until&nbsp;then&nbsp;the&nbsp;</DIV>
<DIV>consumer&nbsp;is&nbsp;inactive&nbsp;and&nbsp;hence&nbsp;won't&nbsp;be&nbsp;included&nbsp;in&nbsp;the&nbsp;consumer-count&nbsp;</DIV>
<DIV>returned&nbsp;by&nbsp;queue.declare-ok.</DIV>
<DIV>&nbsp;</DIV>
<DIV>The&nbsp;RabbitMQ&nbsp;management&nbsp;API/UI&nbsp;isn't&nbsp;bound&nbsp;by&nbsp;AMQP&nbsp;semantics,&nbsp;so&nbsp;it&nbsp;</DIV>
<DIV>always&nbsp;reports&nbsp;all&nbsp;consumers,&nbsp;active&nbsp;or&nbsp;not.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Regards,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Matthias.</DIV>
<DIV>&nbsp;</DIV></DIV></BODY></HTML>