title: How to expire rabbitmq message using amqp.node
body: <p>This is my code: </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const amqp = require('amqplib');
  
  amqp.connect().then((conn) =&gt; {
    var ok = conn.createChannel();
    ok = ok.then((ch) =&gt; {
      ch.assertQueue('myFirstQueue', {
         arguments: {
           messageTtl: 1000
         }
       })
       .then(response =&gt; {
         let q = response;
         let msg = 'hello';
         let message = new Buffer(JSON.stringify(msg).toString('base64'));
         ch.sendToQueue(q.queue, message);
         return ok;
       })
       .catch(error =&gt; {
         return error;
       })
    });
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>What I expect is that the message expires in a second. When I run my consumer in a few seconds, the message arrives!</p>
  
  <p>Reading the <a href="http://www.squaremobius.net/amqp.node/channel_api.html" rel="nofollow noreferrer">documentation</a>, I understand that I simply have to add arguments in options and pass <code>messageTtl</code> in miliseconds.</p>
  
  <p>What I'm doing wrong?</p>