x-max-length parameter

651 views
Skip to first unread message

JA

unread,
May 13, 2019, 8:29:33 AM5/13/19
to rabbitmq-users
Hello everyone,


We are using rabbitmq broker and qpid-cpp-1.39.0 API to send/receive messages to/from broker with AMQP1.0

Our rabbitmq broker provider has several queues with 1 message maximum queue size.

We are only setting the parameter durable true when create the receiver since the queue is created as durable

And the following error is returned from rabbit:

Session ended by peer with amqp:precondition-failed: PRECONDITION_FAILED - inequivalent arg 'x-max-length' for queue 'queue_name ' : received none but current is the value '1' of type 'long'

Is there any way to set the x-max-length parameters over AMQP1.0 or  is there any way to say rabbitmq to not check max queue length for the receiver?

Note that we are using AMQP1.0.

Thanks in advance
Regards

Michael Klishin

unread,
May 13, 2019, 4:03:08 PM5/13/19
to rabbitmq-users
See [1]. There is no way to make RabbitMQ allow for mismatching properties.
However, queue length limits don't have to be declared by clients. Policies have been around for years
and are the recommended way of setting such arbitrary arguments [2][3].

Arguments injected by policies are not considered to be a part of queue declaration arguments and thus they cannot
cause conflicts documented in [1].


--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/d3888d02-f051-4ba1-96bf-1a86ef7afbfb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
MK

Staff Software Engineer, Pivotal/RabbitMQ

JA

unread,
May 14, 2019, 4:28:29 AM5/14/19
to rabbitmq-users
Thanks for the response.

We have define a policy to set the maximum queue length to 1.

And it works properly now

Thanks
Regards


El lunes, 13 de mayo de 2019, 20:03:08 (UTC), Michael Klishin escribió:
See [1]. There is no way to make RabbitMQ allow for mismatching properties.
However, queue length limits don't have to be declared by clients. Policies have been around for years
and are the recommended way of setting such arbitrary arguments [2][3].

Arguments injected by policies are not considered to be a part of queue declaration arguments and thus they cannot
cause conflicts documented in [1].


On Mon, May 13, 2019 at 3:29 PM JA <campan...@gmail.com> wrote:
Hello everyone,


We are using rabbitmq broker and qpid-cpp-1.39.0 API to send/receive messages to/from broker with AMQP1.0

Our rabbitmq broker provider has several queues with 1 message maximum queue size.

We are only setting the parameter durable true when create the receiver since the queue is created as durable

And the following error is returned from rabbit:

Session ended by peer with amqp:precondition-failed: PRECONDITION_FAILED - inequivalent arg 'x-max-length' for queue 'queue_name ' : received none but current is the value '1' of type 'long'

Is there any way to set the x-max-length parameters over AMQP1.0 or  is there any way to say rabbitmq to not check max queue length for the receiver?

Note that we are using AMQP1.0.

Thanks in advance
Regards

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitm...@googlegroups.com.

To post to this group, send email to rabbitm...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/d3888d02-f051-4ba1-96bf-1a86ef7afbfb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sasikala tholisam

unread,
Jun 15, 2019, 2:30:05 AM6/15/19
to rabbitmq-users
I want to set_policy  to one queue only....If I mentioned in place of queues with the name of the queue it will work?
rabbitmqctl.bat set_policy my-pol "^one-meg$" ^
  "{""max-length-bytes"":1048576}" ^
  --apply-to queues
On Tuesday, May 14, 2019 at 1:33:08 AM UTC+5:30, Michael Klishin wrote:
See [1]. There is no way to make RabbitMQ allow for mismatching properties.
However, queue length limits don't have to be declared by clients. Policies have been around for years
and are the recommended way of setting such arbitrary arguments [2][3].

Arguments injected by policies are not considered to be a part of queue declaration arguments and thus they cannot
cause conflicts documented in [1].


On Mon, May 13, 2019 at 3:29 PM JA <campan...@gmail.com> wrote:
Hello everyone,


We are using rabbitmq broker and qpid-cpp-1.39.0 API to send/receive messages to/from broker with AMQP1.0

Our rabbitmq broker provider has several queues with 1 message maximum queue size.

We are only setting the parameter durable true when create the receiver since the queue is created as durable

And the following error is returned from rabbit:

Session ended by peer with amqp:precondition-failed: PRECONDITION_FAILED - inequivalent arg 'x-max-length' for queue 'queue_name ' : received none but current is the value '1' of type 'long'

Is there any way to set the x-max-length parameters over AMQP1.0 or  is there any way to say rabbitmq to not check max queue length for the receiver?

Note that we are using AMQP1.0.

Thanks in advance
Regards

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitm...@googlegroups.com.

To post to this group, send email to rabbitm...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/d3888d02-f051-4ba1-96bf-1a86ef7afbfb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sasikala tholisam

unread,
Jun 24, 2019, 11:35:11 AM6/24/19
to rabbitmq-users
args := make(amqp.Table)
    args["x-max-length-bytes"] = int64(1000000000)
    publisherQueue, err = publisherChannel.QueueDeclare(
        queues.RabbitMQDataQueueName, // name
        false, // durable
        false, // delete when unused
        false, // exclusive
        false, // no-wait
        args, // arguments
    )

Michael Klishin

unread,
Jun 30, 2019, 6:04:03 PM6/30/19
to rabbitmq-users
A regular expression that matches one queue only should work just fine.

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.

To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages