<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=gb2312" 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
}
DIV.FoxDiv20120825092604130718 {
        LINE-HEIGHT: 1.5; FONT-FAMILY: CALIBRI, SANS-SERIF; WORD-WRAP: break-word; COLOR: rgb(0,0,0); FONT-SIZE: 14px; -WEBKIT-NBSP-MODE: SPACE; -WEBKIT-LINE-BREAK: AFTER-WHITE-SPACE
}
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>Thanks, Michael. Actually round-robins dispatching doesn't fit my situation 
well. If two consumers exist, they will get the message almost in the same time. 
In this way, the order of the messages cannot be assured. I wonder if there is 
some way that the server will send the message the second consumer only after it 
receives the ACK from the first consumer.</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:Michael.Laing@nytimes.com">Laing, Michael 
P.</A></DIV>
<DIV><B>Date:</B>&nbsp;2012-08-25&nbsp;03:12</DIV>
<DIV><B>To:</B>&nbsp;<A 
href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq</A>; <A 
href="mailto:johnson@edocom.cn">johnson</A></DIV>
<DIV><B>Subject:</B>&nbsp;Re: [rabbitmq-discuss] How to achieve HA 
consumers?</DIV></DIV></DIV>
<DIV>
<DIV class=FoxDiv20120825092604130718>
<DIV>Actually, rereading, perhaps my solution is different from yours��</DIV>
<DIV><BR></DIV><SPAN id=OLK_SRC_BODY_SECTION>
<DIV 
style="BORDER-BOTTOM: medium none; TEXT-ALIGN: left; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; FONT-FAMILY: Calibri; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><SPAN 
style="FONT-WEIGHT: bold">From: </SPAN>Michael Laing &lt;<A 
href="mailto:Michael.Laing@nytimes.com">Michael.Laing@nytimes.com</A>&gt;<BR><SPAN 
style="FONT-WEIGHT: bold">Reply-To: </SPAN>rabbitmq &lt;<A 
href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</A>&gt;<BR><SPAN 
style="FONT-WEIGHT: bold">Date: </SPAN>Fri, 24 Aug 2012 13:54:15 -0400<BR><SPAN 
style="FONT-WEIGHT: bold">To: </SPAN>johnson &lt;<A 
href="mailto:johnson@edocom.cn">johnson@edocom.cn</A>&gt;, rabbitmq &lt;<A 
href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</A>&gt;<BR><SPAN 
style="FONT-WEIGHT: bold">Subject: </SPAN>Re: [rabbitmq-discuss] How to achieve 
HA consumers?<BR></DIV>
<DIV><BR></DIV>
<DIV>
<DIV 
style="FONT-FAMILY: Calibri, sans-serif; WORD-WRAP: break-word; COLOR: rgb(0,0,0); FONT-SIZE: 14px; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space">
<DIV>I use your option 1: below, which works well.</DIV>
<DIV><BR></DIV>
<DIV>All critical services drive from HA queues and have at least one worker 
(consumer) connected to each node in the cluster. RabbitMQ round-robins messages 
to the workers. If a worker or node fails, its message is routed to another 
worker.</DIV>
<DIV><BR></DIV>
<DIV>Michael</DIV><SPAN id=OLK_SRC_BODY_SECTION>
<DIV 
style="BORDER-BOTTOM: medium none; TEXT-ALIGN: left; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; FONT-FAMILY: Calibri; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><SPAN 
style="FONT-WEIGHT: bold">From: </SPAN>johnson &lt;<A 
href="mailto:johnson@edocom.cn">johnson@edocom.cn</A>&gt;<BR><SPAN 
style="FONT-WEIGHT: bold">Reply-To: </SPAN>johnson &lt;<A 
href="mailto:johnson@edocom.cn">johnson@edocom.cn</A>&gt;, rabbitmq &lt;<A 
href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</A>&gt;<BR><SPAN 
style="FONT-WEIGHT: bold">Date: </SPAN>Fri, 24 Aug 2012 12:30:01 -0400<BR><SPAN 
style="FONT-WEIGHT: bold">To: </SPAN>rabbitmq &lt;<A 
href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</A>&gt;<BR><SPAN 
style="FONT-WEIGHT: bold">Subject: </SPAN>[rabbitmq-discuss] How to achieve HA 
consumers?<BR></DIV>
<DIV><BR></DIV>
<DIV>
<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
}
</STYLE>

<META name=GENERATOR content="MSHTML 8.00.7601.17874">
<DIV style="MARGIN: 10px">
<DIV>Hi,</DIV>
<DIV>&nbsp;</DIV>
<DIV>One problem I encountered is how to achieve HA consumers. My situation is 
the following.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I installed&nbsp;1 consumer in&nbsp;a&nbsp;server to consume the messages. 
But in the production environment,&nbsp;to avoid the unexceptional crash of the 
consumer, I need to install another consumer in another server. However, because 
the order of the messages are very important, if two consumers&nbsp;receive 
the&nbsp;messages simultaneously, the order cannot be reserved.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Maybe the following 2 way can work.</DIV>
<DIV>1: At the same time, the server only sends&nbsp;the message to 1 consumer. 
After that consumer return a ACK, the server send the message to another 
consumer. This means that although two consumers exist, they receive the 
messages in turn <SPAN id=result_box lang=en class=short_text c="4" 
a="undefined" closure_uid_hna1tc="117"><SPAN closure_uid_hna1tc="201">not 
concurrently. Once 1 consumer crashes, the remaining consumer can still 
work.</SPAN></SPAN></DIV>
<DIV><SPAN lang=en class=short_text c="4" a="undefined" 
closure_uid_hna1tc="117"><SPAN 
closure_uid_hna1tc="201"></SPAN></SPAN>&nbsp;</DIV>
<DIV><SPAN lang=en class=short_text c="4" a="undefined" 
closure_uid_hna1tc="117"><SPAN closure_uid_hna1tc="201">2: 2 consumers work like 
master-slave. Only 1 consumer works and the other one doesn't consume any 
message. Once 1 consumer crashes, the remaining consumer will be 
activated.</SPAN></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV>I have searched a lot of RabbitMQ docs and couldn't find useful info. Could 
anyone can give me some clue? Thanks a lot.</DIV>
<DIV>&nbsp;</DIV>
<DIV>
<HR style="WIDTH: 210px; HEIGHT: 1px" align=left color=#b5c4df SIZE=1>
</DIV>
<DIV><SPAN>johnson</SPAN></DIV></DIV></DIV></SPAN></DIV></DIV></SPAN></DIV></DIV></BODY></HTML>