Skip to content

How to set queue x-max-length parameter #130

Description

@rogeriobiondi

Hello,

I'm trying to setup the x-max-length parameter in my queues:

rabbitmqctl set_policy Ten "^one-meg$" '{"x-max-length": 10}' --apply-to queues

But when trying to use rabbit.js I'm getting the following error:

Error: Channel closed by server: 406 (PRECONDITION-FAILED) with message "PRECONDITION_FAILED - inequivalent arg 'x-max-length' for queue 'WORKER' in vhost '/': received none but current is the value '10' of type 'signedint'"

In python (pika) I can set this parameter the following way:

credentials = pika.PlainCredentials('user', 'pw')
parameters = pika.ConnectionParameters(host='127.0.0.1',
port=5672,
virtual_host='/',
credentials = credentials,
heartbeat_interval = 60)
connection = pika.BlockingConnection(parameters)
channel = connection.channel()
args = { "x-max-length": 10 }
channel.queue_declare(queue="WORKER", durable=True, arguments=args)

May you clarify me how this could be accomplished using rabbit.js?

Thank you very much for your help.

Best regards,
Rogerio

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions