<div dir="ltr"><div>Hi <br><br></div>Thanks for the reply.<br><br>My inline response are below.<br><div class="im"><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Simon MacMullen</b> <span dir="ltr">&lt;<a href="mailto:simon@rabbitmq.com" target="_blank">simon@rabbitmq.com</a>&gt;</span><br>

Date: Mon, Jul 1, 2013 at 2:44 PM<br>Subject: Re: [rabbitmq-discuss] Active-Active implementation issues<br>To: Discussions about RabbitMQ &lt;<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">rabbitmq-discuss@lists.rabbitmq.com</a>&gt;<br>

Cc: Gomathi Nayagam &lt;<a href="mailto:sgnayagam@gmail.com" target="_blank">sgnayagam@gmail.com</a>&gt;<br><br><br>Hi. Couple of points:<br>
<br>
1) It&#39;s not *guaranteed* that after you acknowledge a message you will 
never see it again after failover - the ack has to travel across the 
network and be received by the broker, and if failover happens between 
the broker sending the message out and receiving an ack then you will 
see the message again.<br>
</div><div class="gmail_quote"><br></div></div><div class="gmail_quote">[Reply] I agree with this point. <br></div><div class="gmail_quote"><div class="im"><br>
<br>
2) If this is not happening, make sure you are acknowledging the 
messages correctly - make sure they vanish from the console when 
failover is not an issue.<br><br></div>[Reply] Let&#39;s take the below 
example, the queue has 20 messages and after 13 
messages are consumed (11 messages are acked, 2 messages ack are not 
reached to broker) Node1 is down. So in the Node2 we could see 9 
messages. But the consumer consumes and acked all 9 messages (i can get 
the print statements inside handleCancel()) during the fail over, but 
the messages are not vanishing from the console. It leads to duplication
 of messages.<br>
<br></div>Thanks<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 1, 2013 at 3:31 PM, Gomathi Nayagam <span dir="ltr">&lt;<a href="mailto:sgnayagam@gmail.com" target="_blank">sgnayagam@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi <br><br></div>Thanks for the reply.<br><br></div>My inline response are below.<br><div><div>
<div><div class="im"><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Simon MacMullen</b> <span dir="ltr">&lt;<a href="mailto:simon@rabbitmq.com" target="_blank">simon@rabbitmq.com</a>&gt;</span><br>

Date: Mon, Jul 1, 2013 at 2:44 PM<br>Subject: Re: [rabbitmq-discuss] Active-Active implementation issues<br>To: Discussions about RabbitMQ &lt;<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">rabbitmq-discuss@lists.rabbitmq.com</a>&gt;<br>

Cc: Gomathi Nayagam &lt;<a href="mailto:sgnayagam@gmail.com" target="_blank">sgnayagam@gmail.com</a>&gt;<br><br><br>Hi. Couple of points:<br>
<br>
1) It&#39;s not *guaranteed* that after you acknowledge a message you will never see it again after failover - the ack has to travel across the network and be received by the broker, and if failover happens between the broker sending the message out and receiving an ack then you will see the message again.<br>

</div><div class="gmail_quote"><br></div></div><div class="gmail_quote">[Reply] I agree with this point. <br></div><div class="gmail_quote"><div class="im"><br>
<br>
2) If this is not happening, make sure you are acknowledging the messages correctly - make sure they vanish from the console when failover is not an issue.<br><br></div>[Reply] Let&#39;s take the below example, the queue has 20 messages and after 13 
messages are consumed (11 messages are acked, 2 messages ack are not 
reached to broker) Node1 is down. So in the Node2 we could see 9 messages. But the consumer consumes and acked all 9 messages (i can get the print statements inside handleCancel()) during the fail over, but the messages are not vanishing from the console. It leads to duplication of messages.<br>

<br></div><div class="gmail_quote">Thanks<br></div><div><div class="h5"><div class="gmail_quote">
<br>
Cheers, Simon<div><div><br>
<br>
On 01/07/2013 09:33, Gomathi Nayagam wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>
I am trying to implement the active-active High availability Queue and i<br>
have some issues in the implementation. The problem is when we consume<br>
messages from the Mirrored queue if any one of the node is down, we can<br>
able to consume the messages after the node failure. But the consumed<br>
messages after the node failure are still available in the rabbitmq<br>
console even after acking all of the messages.<br>
<br>
Some information about the overview of the configuration to test<br>
active-active queues<br>
<br>
I have NODE1 in Host1 and NODE2 in Host2. Both of the nodes are in<br>
cluster. I have a Queue named TestQ in NODE1, since i have made this<br>
queue (TestQ) as Mirrored Queue through the policies it is available in<br>
Node2 which is running in Host2.<br>
<br>
I am passing the array of Address(Host1, Host2) to get the connection in<br>
my consumer. the code snippet is<br>
<br>
Address address1 = new Address(Host1, 5672);<br>
Address address2 = new Address(Host2, 5672);<br>
<br>
RabbitmqConsumer consumer = new RabbitmqConsumer(new Address[]{address1,<br>
address2}, queue);<br>
<br>
While getting the connection,<br>
Connection conn = connectionFactory.<u></u>newConnection(addresses);<br>
<br>
My use case is as below.<br>
<br>
I have 30 messages in TestQ and i can see it in the RabbitMQ console of<br>
Host1,Host2 looks like below<br>
<br>
Host1:<br>
Name � �Node<br>
TestQ � �rabbit@Node2<br>
<br>
Host2:<br>
Name � �Node<br>
TestQ � �rabbit@Node2<br>
<br>
In my consumer, I have implemented my own consumer as below.<br>
<br>
class MyConsumer extends QueueingConsumer{<br>
<br>
� � �Channel channel;<br>
� � �public MyConsumer(Channel ch) {<br>
� � � � �super(ch);<br>
� � � � �this.channel = ch;<br>
� � �}<br>
<br>
� � �@Override<br>
� � �public void handleCancel(String consumerTag) �{<br>
� � � � �System.out.println(&quot;<u></u>handleCancel :: consumertag &quot;+consumerTag+&quot;<br>
channel opened &quot;+channel.isOpen()+&quot;,channel &quot;+channel+&quot;, rabbitmq<br>
consumer ch &quot;+RabbitmqConsumer.ch);<br>
<br>
� � �}<br>
}<br>
<br>
If i run my consumer, it creates a channel with the reference of<br>
AMQChannel(amqp://guest@Host1:<u></u>5672/,1) and it consumes the messasges<br>
from the TestQ. I have checked the consumer tag of the channel in both<br>
of the host and both are same.<br>
<br>
After some of the messages (assume 10 messages) are consumed, i<br>
explicitly down the Node2 by giving the below command<br>
<br>
node2$ ./rabbitmqctl stop_app<br>
<br>
After the failure of Node2, i can see the print statements which i added<br>
in the handleCancel() method and consumer consumes all of the messages<br>
with out any error. The problem is the even though the remaining 20<br>
messages are consumed and acked in the consumer, but if i check it in<br>
the rabbitmq console, the 20 messages are still exists in the TestQ.<br>
<br>
What i have to do in this scenario to overcome this issue.<br>
<br>
<br></div></div>
______________________________<u></u>_________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">rabbitmq-discuss@lists.<u></u>rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/<u></u>cgi-bin/mailman/listinfo/<u></u>rabbitmq-discuss</a><br>
<br>
</blockquote>
<br>
</div><br></div></div></div></div></div></div>
</blockquote></div><br></div>