[rabbitmq-discuss] When I declared mirrored queues using spring-rabbit API, one of them is sometimes failed.

Min Cha minslovey at gmail.com
Tue Aug 14 08:54:53 BST 2012


Hi all.
First of all, thanks for rabbitmq team & community. With rabbitmq, our
production environment has been improving.
I am very pleased if you help me.

*Environment*

1. rabbit-mq 2.8.4(and java client 2.8.4), spring-amqp 1.1.0, spring-rabbit
1.1.0.
2. erlang RB15B01

*Problem*

1. When I declared mirrored queues using spring-rabbit API, one of them is
sometimes failed.
2. As a result, the failed queue(s) does not exist.
3. When I rerun my code without any changes, it is sometimes success.
4. Code for declaring the queues is as following.

*<bean id="notificationAddCommentQueue"
class="org.springframework.amqp.core.Queue">*
* <constructor-arg name="name" value="cafe.notification.addComment" />*
* <constructor-arg name="autoDelete" value="false" />*
* <constructor-arg name="exclusive" value="false" />*
* <constructor-arg name="durable" value="true" />*
* <constructor-arg name="arguments">*
* <map>*
* <entry key="x-ha-policy" value="all" />*
* </map>*
* </constructor-arg>*
*</bean>*
*
*
*...*

*for (Queue queue : queues) {*
*  rabbitAdmin.deleteQueue(queue.getName());*
*  rabbitAdmin.declareQueue(queue);*
*}*

5. Error logs on rabbitmq-server is as following.

*=INFO REPORT==== 14-Aug-2012::16:32:05 ===*
*Mirrored-queue (queue 'cafe.ping' in vhost 'cafe'): Promoting slave
<mq1 at NVCAFMQ1501.3.853.2> to master*
*
*
*=ERROR REPORT==== 14-Aug-2012::16:32:06 ===*
*** Generic server <0.854.2> terminating*
*** Last message in was {'$gen_cast',*
*                        {broadcast,*
*                         {delete_and_terminate,*
*                          {{case_clause,{error,not_found}},*
*                           [{rabbit_amqqueue_process,i,2,[]},*
*
{rabbit_amqqueue_process,'-infos/2-lc$^0/1-0-',2,*
*                             []},*
*
{rabbit_amqqueue_process,'-infos/2-lc$^0/1-0-',2,*
*                             []},*
*                            {rabbit_amqqueue_process,infos,2,[]},*
*                            {rabbit_amqqueue_process,emit_stats,2,[]},*
*                            {rabbit_event,if_enabled,3,[]},*
*
{rabbit_amqqueue_process,handle_pre_hibernate,1,*
*                             []},*
*                            {gen_server2,pre_hibernate,1,[]}]}}}}*
*** When Server state == {state,*
*                            {4,<0.854.2>},*
*                            {{4,<0.854.2>},undefined},*
*                            {{4,<0.854.2>},undefined},*
*                            {resource,<<"cafe">>,queue,<<"cafe.ping">>},*
*                            rabbit_mirror_queue_coordinator,*
*                            {9,*
*                             [{{4,<0.854.2>},*
*                               {view_member,*
*                                   {4,<0.854.2>},*
*                                   [],*
*                                   {4,<0.854.2>},*
*                                   {4,<0.854.2>}}}]},*
*                            4,[],*
*                            [<0.855.2>],*
*                            {[],[]},*
*                            [],undefined}*
*** Reason for termination == *
*** {{case_clause,{error,not_found}},*
*    [{rabbit_amqqueue_process,i,2,[]},*
*     {rabbit_amqqueue_process,'-infos/2-lc$^0/1-0-',2,[]},*
*     {rabbit_amqqueue_process,'-infos/2-lc$^0/1-0-',2,[]},*
*     {rabbit_amqqueue_process,infos,2,[]},*
*     {rabbit_amqqueue_process,emit_stats,2,[]},*
*     {rabbit_event,if_enabled,3,[]},*
*     {rabbit_amqqueue_process,handle_pre_hibernate,1,[]},*
*     {gen_server2,pre_hibernate,1,[]}]}*


                                 [{file,"proc_lib.erl"},{line,227}]}]}}
** When Server state == {q,
                         {amqqueue,
                          {resource,<<"cafe">>,queue,<<"cafe.ping">>},
                          true,false,none,
                          [{<<"x-ha-policy">>,longstr,<<"all">>}],
                          <0.22597.1>,[],all},
                         none,false,rabbit_mirror_queue_master,
                         {state,<0.22598.1>,<0.22781.1>,
                          rabbit_variable_queue,
                          {vqstate,
                           {0,{[],[]}},
                           {0,{[],[]}},
                           {delta,undefined,0,undefined},
                           {0,{[],[]}},
                           {1,
                            {[{msg_status,0,

 <<176,245,83,92,212,158,235,71,163,59,227,246,
                                 180,233,129,198>>,
                               {basic_message,

{resource,<<"cafe">>,exchange,<<"cafe.ping">>},
                                [<<"cafe.ping">>],
                                {content,60,
                                 {'P_basic',<<"application/json">>,
                                  <<"UTF-8">>,
                                  [{<<"__TypeId__">>,longstr,
                                    <<"java.lang.String">>}],

2,0,undefined,undefined,undefined,undefined,
                                  undefined,undefined,undefined,undefined,
                                  undefined},

 <<248,0,16,97,112,112,108,105,99,97,116,105,

 111,110,47,106,115,111,110,5,85,84,70,45,56,

 0,0,0,32,10,95,95,84,121,112,101,73,100,95,

 95,83,0,0,0,16,106,97,118,97,46,108,97,110,
                                   103,46,83,116,114,105,110,103,2,0>>,
                                 rabbit_framing_amqp_0_9_1,
                                 [<<"\"NVCAFBE1501.nhnjp.ism
cafe-api-server : Tue Aug 14 16:32:03 JST 2012\"">>]},

<<176,245,83,92,212,158,235,71,163,59,227,246,
                                  180,233,129,198>>,
                                true},
                               true,false,true,true,
                               {message_properties,undefined,false}}],
                             []}},
                           1,
                           {0,nil},
                           undefined,
                           {0,nil},
                           {qistate,

"/home/www/rabbitmq_server-2.8.4/sbin/../var/lib/rabbitmq/mnesia/mq2/queues/9QF3UUJUE12OVYVA26GQJ1FFU",
                            {{dict,0,16,16,8,80,48,
                              {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],
                               []},

{{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],

...




-- 
Min Cha, Software Developer

Projects involved
- CoRepository : https://github.com/MinCha/corepository
- Good-Samples : http://code.google.com/p/good-samples/

Blog
- (Eng) http://minslovey.blogspot.com
- (Kor) http://minslovey.tistory.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120814/dc8d9767/attachment.htm>


More information about the rabbitmq-discuss mailing list