Foo-Foo-MQ / foo-foo-mq

Abstractions around RabbitMQ
MIT License
48 stars 24 forks source link

Is there support to set queue type (x-queue-type) when adding a queue (quorum support)? #54

Closed MartianH closed 4 months ago

MartianH commented 4 months ago

Greetings,

As per the documentation (Topology | addQueue) these should be all available arguments. I might have missed something but I do not see how to set x-queue-type.

As you already know classic queues will be removed entirely in v4.0 of RabbitMQ (see here). As such, I assume thios lib should have an argument to set x-queue-type to quorum.

Thanks in advance.

MartianH commented 4 months ago

Found the solution after digging in the code. While this is not documented, you can pass the same arguments object in the config object for a queue as for amqpLib (assertQUeue).

queues: [
    {
        name: RABBITMQ_QUEUE,
        limit: 1000,
        subscribe: true,
       // maxPriority: 100 <-- does not work for quorum queues
        arguments: { 'x-queue-type': 'quorum' }
    },
]

This will be passed straight to amqplib function.