Hi all.<div>First of all, thanks for rabbitmq team & community. With rabbitmq, our production environment has been improving.</div><div>I am very pleased if you help me. </div><div><br></div><div>*Environment*</div><div>
<br></div><div><div>1. rabbit-mq 2.8.4(and java client 2.8.4), spring-amqp 1.1.0, spring-rabbit 1.1.0.</div><div>2. erlang RB15B01</div><div><br></div></div><div>*Problem*</div><div><br></div><div>1. When I declared mirrored queues using spring-rabbit API, one of them is sometimes failed.</div>
<div>2. As a result, the failed queue(s) does not exist.</div><div>3. When I rerun my code without any changes, it is sometimes success.</div><div>4. Code for declaring the queues is as following.</div><div><br></div><div>
<div><i><bean id="notificationAddCommentQueue" class="org.springframework.amqp.core.Queue"></i></div><div><i><span class="Apple-tab-span" style="white-space:pre">        </span><constructor-arg name="name" value="cafe.notification.addComment" /></i></div>
<div><i><span class="Apple-tab-span" style="white-space:pre">        </span><constructor-arg name="autoDelete" value="false" /></i></div><div><i><span class="Apple-tab-span" style="white-space:pre">        </span><constructor-arg name="exclusive" value="false" /></i></div>
<div><i><span class="Apple-tab-span" style="white-space:pre">        </span><constructor-arg name="durable" value="true" /></i></div><div><i><span class="Apple-tab-span" style="white-space:pre">        </span><constructor-arg name="arguments"></i></div>
<div><i><span class="Apple-tab-span" style="white-space:pre">                </span><map></i></div><div><i><span class="Apple-tab-span" style="white-space:pre">                        </span><entry key="x-ha-policy" value="all" /></i></div>
<div><i><span class="Apple-tab-span" style="white-space:pre">                </span></map></i></div><div><i><span class="Apple-tab-span" style="white-space:pre">        </span></constructor-arg></i></div><div><i></bean></i></div>
</div><div><i><br></i></div><div><i>...</i></div><div><br></div><div><i>for (Queue queue : queues) {</i></div><div><div><i>  rabbitAdmin.deleteQueue(queue.getName());</i></div><div><i>  rabbitAdmin.declareQueue(queue);</i></div>
<div><i>}</i></div></div><div><br></div><div>5. Error logs on rabbitmq-server is as following.</div><div><br></div><div><i>=INFO REPORT==== 14-Aug-2012::16:32:05 ===</i></div><div><div><i>Mirrored-queue (queue 'cafe.ping' in vhost 'cafe'): Promoting slave <mq1@NVCAFMQ1501.3.853.2> to master</i></div>
<div><i><br></i></div><div><i>=ERROR REPORT==== 14-Aug-2012::16:32:06 ===</i></div><div><i>** Generic server <0.854.2> terminating</i></div><div><i>** Last message in was {'$gen_cast',</i></div><div><i>                        {broadcast,</i></div>
<div><i>                         {delete_and_terminate,</i></div><div><i>                          {{case_clause,{error,not_found}},</i></div><div><i>                           [{rabbit_amqqueue_process,i,2,[]},</i></div>
<div><i>                            {rabbit_amqqueue_process,'-infos/2-lc$^0/1-0-',2,</i></div><div><i>                             []},</i></div><div><i>                            {rabbit_amqqueue_process,'-infos/2-lc$^0/1-0-',2,</i></div>
<div><i>                             []},</i></div><div><i>                            {rabbit_amqqueue_process,infos,2,[]},</i></div><div><i>                            {rabbit_amqqueue_process,emit_stats,2,[]},</i></div>
<div><i>                            {rabbit_event,if_enabled,3,[]},</i></div><div><i>                            {rabbit_amqqueue_process,handle_pre_hibernate,1,</i></div><div><i>                             []},</i></div>
<div><i>                            {gen_server2,pre_hibernate,1,[]}]}}}}</i></div><div><i>** When Server state == {state,</i></div><div><i>                            {4,<0.854.2>},</i></div><div><i>                            {{4,<0.854.2>},undefined},</i></div>
<div><i>                            {{4,<0.854.2>},undefined},</i></div><div><i>                            {resource,<<"cafe">>,queue,<<"cafe.ping">>},</i></div><div><i>                            rabbit_mirror_queue_coordinator,</i></div>
<div><i>                            {9,</i></div><div><i>                             [{{4,<0.854.2>},</i></div><div><i>                               {view_member,</i></div><div><i>                                   {4,<0.854.2>},</i></div>
<div><i>                                   [],</i></div><div><i>                                   {4,<0.854.2>},</i></div><div><i>                                   {4,<0.854.2>}}}]},</i></div><div><i>                            4,[],</i></div>
<div><i>                            [<0.855.2>],</i></div><div><i>                            {[],[]},</i></div><div><i>                            [],undefined}</i></div><div><i>** Reason for termination == </i></div>
<div><i>** {{case_clause,{error,not_found}},</i></div><div><i>    [{rabbit_amqqueue_process,i,2,[]},</i></div><div><i>     {rabbit_amqqueue_process,'-infos/2-lc$^0/1-0-',2,[]},</i></div><div><i>     {rabbit_amqqueue_process,'-infos/2-lc$^0/1-0-',2,[]},</i></div>
<div><i>     {rabbit_amqqueue_process,infos,2,[]},</i></div><div><i>     {rabbit_amqqueue_process,emit_stats,2,[]},</i></div><div><i>     {rabbit_event,if_enabled,3,[]},</i></div><div><i>     {rabbit_amqqueue_process,handle_pre_hibernate,1,[]},</i></div>
<div><i>     {gen_server2,pre_hibernate,1,[]}]}</i></div></div><div><br></div><div><br></div><div><div>                                 [{file,"proc_lib.erl"},{line,227}]}]}}</div><div>** When Server state == {q,</div>
<div>                         {amqqueue,</div><div>                          {resource,<<"cafe">>,queue,<<"cafe.ping">>},</div><div>                          true,false,none,</div>
<div>                          [{<<"x-ha-policy">>,longstr,<<"all">>}],</div><div>                          <0.22597.1>,[],all},</div><div>                         none,false,rabbit_mirror_queue_master,</div>
<div>                         {state,<0.22598.1>,<0.22781.1>,</div><div>                          rabbit_variable_queue,</div><div>                          {vqstate,</div><div>                           {0,{[],[]}},</div>
<div>                           {0,{[],[]}},</div><div>                           {delta,undefined,0,undefined},</div><div>                           {0,{[],[]}},</div><div>                           {1,</div><div>                            {[{msg_status,0,</div>
<div>                               <<176,245,83,92,212,158,235,71,163,59,227,246,</div><div>                                 180,233,129,198>>,</div><div>                               {basic_message,</div><div>
                                {resource,<<"cafe">>,exchange,<<"cafe.ping">>},</div><div>                                [<<"cafe.ping">>],</div><div>                                {content,60,</div>
<div>                                 {'P_basic',<<"application/json">>,</div><div>                                  <<"UTF-8">>,</div><div>                                  [{<<"__TypeId__">>,longstr,</div>
<div>                                    <<"java.lang.String">>}],</div><div>                                  2,0,undefined,undefined,undefined,undefined,</div><div>                                  undefined,undefined,undefined,undefined,</div>
<div>                                  undefined},</div><div>                                 <<248,0,16,97,112,112,108,105,99,97,116,105,</div><div>                                   111,110,47,106,115,111,110,5,85,84,70,45,56,</div>
<div>                                   0,0,0,32,10,95,95,84,121,112,101,73,100,95,</div><div>                                   95,83,0,0,0,16,106,97,118,97,46,108,97,110,</div><div>                                   103,46,83,116,114,105,110,103,2,0>>,</div>
<div>                                 rabbit_framing_amqp_0_9_1,</div><div>                                 [<<"\"NVCAFBE1501.nhnjp.ism cafe-api-server : Tue Aug 14 16:32:03 JST 2012\"">>]},</div>
<div>                                <<176,245,83,92,212,158,235,71,163,59,227,246,</div><div>                                  180,233,129,198>>,</div><div>                                true},</div><div>                               true,false,true,true,</div>
<div>                               {message_properties,undefined,false}}],</div><div>                             []}},</div><div>                           1,</div><div>                           {0,nil},</div><div>                           undefined,</div>
<div>                           {0,nil},</div><div>                           {qistate,</div><div>                            "/home/www/rabbitmq_server-2.8.4/sbin/../var/lib/rabbitmq/mnesia/mq2/queues/9QF3UUJUE12OVYVA26GQJ1FFU",</div>
<div>                            {{dict,0,16,16,8,80,48,</div><div>                              {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],</div><div>                               []},</div><div>                              {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],</div>
</div><div><br></div><div>...</div><div><br></div><div><br></div><div><br clear="all"><div><br></div>-- <br>Min Cha, Software Developer<br><br>Projects involved<div>- CoRepository : <a href="https://github.com/MinCha/corepository" target="_blank">https://github.com/MinCha/corepository</a><br>
- Good-Samples : <a href="http://code.google.com/p/good-samples/" target="_blank">http://code.google.com/p/good-samples/</a><br><br><div>Blog<br>- (Eng) <a href="http://minslovey.blogspot.com" target="_blank">http://minslovey.blogspot.com</a><br>
- (Kor) <a href="http://minslovey.tistory.com" target="_blank">http://minslovey.tistory.com</a></div></div><br>
</div>