<div>Hello,<br></div><div><br></div><div>Working with rabbitmq, I found a nasty behavior relating to queue and their TTL. If you send a persistant message to a durable queue when the queue have a TTL over 4.294.967.295 (max 32bit int, or FF FF FF FF), then the queue is destroyed if the message is not consumed immediately.</div>

<div><br></div><div>Here the simplest test I have made :</div><div>a user &quot;test_user&quot; (with a password &quot;test_user&quot;) ;</div><div>a vhost &quot;p&quot; ;</div><div>a queue named &quot;test&quot;, durable, with a TTL &gt; 4.294.967.295 (no autodelete) ;</div>

<div>no arguments ;</div><div><br></div><div>the direct exchange &quot;amq.direct&quot; bind to the queue with no routing key and no arguments ;</div><div><br></div><div>send a persistant message  (delivery mode = 2, no routing key, no header nor properties, only a basic payload &quot;bla&quot;).</div>

<div><br></div><div>Then the queue is destroyed.</div><div><br></div><div>Rabbitmq version 2.7.1</div><div>test made with management interface and php client.</div><div><br></div><div>I think this is related to the storage of the message (due to the behavior I observed while testing with shovels).</div>
<div><br></div><div>I may not need a so large TTL, but I think you should know about this.</div><div><br></div><div>Here is the error log :</div><div><br></div><div>=ERROR REPORT==== 13-Apr-2012::16:09:13 ===<br>** Generic server &lt;0.31584.0&gt; terminating<br>
** Last message in was {deliver,<br>                        {delivery,true,false,&lt;0.9065.1&gt;,<br>                         {basic_message,<br>                          {resource,&lt;&lt;&quot;p&quot;&gt;&gt;,exchange,&lt;&lt;&quot;amq.direct&quot;&gt;&gt;},<br>
                          [&lt;&lt;&gt;&gt;],<br>                          {content,60,<br>                           {&#39;P_basic&#39;,undefined,undefined,[],2,undefined,<br>                            undefined,undefined,undefined,undefined,undefined,<br>
                            undefined,undefined,undefined,undefined},<br>                           none,none,<br>                           [&lt;&lt;&quot;bla&quot;&gt;&gt;]},<br>                          &lt;&lt;&quot;Y&lt;C9&gt;&lt;FF&gt;e&lt;B1&gt;&lt;B6&gt;d&lt;A1&gt; ZU&lt;D6&gt;&lt;E9&gt;&lt;E0&gt;&lt;E2&gt;&lt;BE&gt;&quot;&gt;&gt;,true},<br>
                         1}}<br>** When Server state == {q,<br>                         {amqqueue,<br>                          {resource,&lt;&lt;&quot;p&quot;&gt;&gt;,queue,&lt;&lt;&quot;test&quot;&gt;&gt;},<br>                          true,false,none,<br>
                          [{&lt;&lt;&quot;x-message-ttl&quot;&gt;&gt;,long,4294967296}],<br>                          &lt;0.31584.0&gt;,[],undefined},<br>                         none,false,rabbit_variable_queue,<br>                         {vqstate,<br>
                          {0,{[],[]}},<br>                          {0,{[],[]}},<br>                          {delta,undefined,0,undefined},<br>                          {0,{[],[]}},<br>                          {0,{[],[]}},<br>
                          0,<br>                          {0,nil},<br>                          undefined,<br>                          {0,nil},<br>                          {qistate,<br>                           &quot;/var/lib/rabbitmq/mnesia/rabbit@rabbithost/queues/BKL005Z7FOY4NF6WMR7ER<br>
BLZV&quot;,<br>                           {{dict,0,16,16,8,80,48,<br>                             {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},<br>                             {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],<br>
                               []}}},<br>                            []},<br></div><div>                           undefined,0,262144,<br>                           #Fun&lt;rabbit_variable_queue.2.91259159&gt;,<br>                           {0,nil}},<br>
                          {{client_msstate,msg_store_persistent,<br>                            &lt;&lt;72,21,86,28,220,67,150,223,124,123,50,154,225,<br>                              109,132,157&gt;&gt;,<br>                            {dict,0,16,16,8,80,48,<br>
                             {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},<br>                             {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],<br>                               []}}},<br>                            {state,1134659,<br>
                             &quot;/var/lib/rabbitmq/mnesia/rabbit@rabbithost/msg_store_persistent&quot;},<br>                            rabbit_msg_store_ets_index,<br>                            &quot;/var/lib/rabbitmq/mnesia/rabbit@rabbithost/msg_store_persistent&quot;,<br>
                            &lt;0.11231.0&gt;,1138754,1130564,1142841,1146950},<br>                           {client_msstate,msg_store_transient,<br>                            &lt;&lt;154,31,168,204,117,254,217,155,174,95,243,199,81,<br>
                              128,111,88&gt;&gt;,<br>                            {dict,0,16,16,8,80,48,<br>                             {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},<br>                             {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],<br>
                               []}}},<br>                            {state,1114170,<br>                             &quot;/var/lib/rabbitmq/mnesia/rabbit@rabbithost/msg_store_transient&quot;},<br>                            rabbit_msg_store_ets_index,<br>
                            &quot;/var/lib/rabbitmq/mnesia/rabbit@rabbithost/msg_store_transient&quot;,<br>                            &lt;0.11226.0&gt;,1118269,1110080,1122364,1126465}},<br>                          true,0,#Fun&lt;rabbit_amqqueue_process.5.18121064&gt;,0,0,<br>
                          infinity,0,0,0,0,0,<br>                          {rates,<br>                           {{1334,325010,274464},0},<br>                           {{1334,325010,274464},0},<br>                           0.0,0.0,<br>
                           {1334,325011,275021}},<br>                          {0,nil},<br>                          {0,nil},<br>                          {0,nil},<br>                          {0,nil},<br>                          0,0,<br>
                          {rates,<br>                           {{1334,325010,274464},0},<br>                           {{1334,325010,274464},0},<br>                           0.0,0.0,<br>                           {1334,325011,275021}}},<br>
                         {[],[]},<br>                         undefined,undefined,undefined,undefined,<br>                         {state,fine,5000,undefined},<br>                         {0,nil},<br>                         4294967296,undefined}<br>
</div><div>** Reason for termination == <br>** {badarg,[{erlang,send_after,[4294967296,&lt;0.31584.0&gt;,drop_expired]},<br>            {rabbit_amqqueue_process,ensure_ttl_timer,1},<br>            {rabbit_amqqueue_process,handle_call,3},<br>
            {gen_server2,handle_msg,2},<br>            {proc_lib,wake_up,3}]}<br></div>