RabbitMQ - Unable to set x-message-ttl

Hi,

I would like to know is there is a bug in the rabbitmq trigger or if I don’t set the trigger properly.
I want to set the argument x-message-ttl with a certain dely (like 5000ms)

I try to set an Argument like this :

  • Key : x-message-ttl
  • value : 5000 (Rabbit want an long)

I have this message :

When the queue is configured before the trigger, I have this message
ERROR: Operation failed: QueueDeclare; 406 (PRECONDITION-FAILED) with message "PRECONDITION_FAILED - inequivalent arg 'x-message-ttl' for queue 'n8n-geoloc-amqp' in vhost '/': received '5000' but current is '5000'"
In rabbitMQ is a long value. I think the Two value type are différent 'String in n8n and long in rabbitmq

If the Queue is initialized with n8n (Queue does not exist in rabbitMQ), I have this message :

ERROR: Operation failed: QueueDeclare; 406 (PRECONDITION-FAILED) with message "PRECONDITION_FAILED - inequivalent arg 'x-message-ttl' for queue 'myqueue' in vhost '/': received the value '5000' of type 'longstr' but current is none"

Do I made so mistake ?
Is there a way to configure TTL with the trigger ?

Thanks

Information on your n8n setup

  • n8n version: 0.194
  • Database you’re using (default: SQLite):MariaDB
  • Running n8n with the execution process [own(default), main]: Via Worker node (2)
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]:Docker

Hi @Gsyltc, I am sorry for the trouble.

I am not very familiar with RabbitMQ but I think x-message-ttl would be something to set on the regular RabbitMQ node rather than the trigger (since it specifies the TTL of a message being published rather than received) - though I might easily miss something here.

If you let n8n initialize the queue you should be able to set x-message-ttl by using an expression of {{ 5000 }}. This means n8n uses a numeric value rather than a string and worked for me when testing this just now:

Hope this helps!

1 Like

Hi @MutedJam,

Thanks for your reply.
In RabbitMQ you can specify somes arguments when créating a queue with a client. If the client and server don’t have the same parameter it will not work.

So, is the reason why I need to specify the value in the trigger and the server. the n8n trigger can create queue too. So, it’s necessary to specify the argument.

But with your help, it works. I have an expression now with the value {{ 5000 }}.
The rabbitMQ trigger can create a queue with a specific ttl.

Thank you

1 Like

TIL, thanks so much for sharing! Also, I am really glad to hear {{ 5000 }} worked for you despite my initial thought being wrong here :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.