How to find rabbitmq setting for queue lenght limit value - rabbitmq

we use rabbitmq ,doc tell us how to setting Queue Length Limit .
but we haven't find Queue Length Limit default value .
has someone know that?

By default, there is not a default value,
You can use the command line tool to check the argouments:
rabbitmqctl list_queues name arguments
Timeout: 60.0 seconds ...
Listing queues for vhost / ...
name arguments
my_queue_limit [{"x-max-length",5000}]
queue_no_limit []
or the management UI
as you can see my_queue_limit is set to 5000
queue_no_limit is without limits

By default, rabbitmq queues are unbounded in nature i.e., they have no limit. But if you wish to impose some limit on the queue you can set it by using the x-max-length argument.

Related

Do RabbitMq policies override queue parameters?

Problem
Our clients can create their own queues on the RabbitMq cluster and we need to control the important parameters on the queue (ttl, expiration etc.).
The issue is that we cannot be sure what value is actually applied: the one from x-arguments or the policy.
Question
In this rabbitmq documentation, there is nicely explained how are different policies resolved but it does not mention the priority of x-arguments.
So if the queue is created with x-message-ttl : 180000 and the applied policy defines message-ttl : 100000, like this :
... what will be the applied value?
Answer is likely Yes
It looks like policies do override the queue x-attribute.
Why ?
Well, it did for max-length in this small test (with ver 3.10.11) :
Queue was created with x-max-length: 5
Policy of max-lenght: 3 applied
Number of ready messages dropped from 5 to 3

Ignite TcpCommunicationSpi : Can slowClientQueueLimit be set to same value as messageQueueLimit as per docs?

I am not completely sure of the meaning or the interplay between slowClientQueueLimit and messageQueueLimit.
As per the documentation, they both should ideally be set to the same value, https://ignite.apache.org/releases/2.4.0/javadoc/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.html#setSlowClientQueueLimit-int-
However when i do set that i see this in the logs, is it a minor bug in the check or should i change this?
[WARN ] 2018-06-27 22:32:18.429 [main] org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi - Slow client queue limit is set to a value greater than message queue limit (slow client queue limit will have no effect) [msgQueueLimit=1024, slowClientQueueLimit=1024]
Thanks
From code the warning is correct, but javadoc is not. slowClientQueueLimit has to be less than msgQueueLimit, because when message is being prepared to sending, first are checked back pressure limits, and only then slowClientQueueLimit. If these two numbers are equal, sender thread will be blocked by back pressure before it could go to slow client check. What means client would not be dropped.
Set slowClientQueueLimit to msgQueueLimit - 1 or less, and I'll suggest community to fix the docs.

How to make rabbitmq to refuses messages when a queue is full?

I have a http server which receives some messages and must reply 200 when a message is successfully stored in a queue and 500 is the message is not added to the queue.
I would like rabbitmq to refuse my messages when the queue reach a size limit.
How can I do it?
actually you can't configure RabbitMq is such a way. but you may programatically check queue size like:
`DeclareOk queueOkStatus = channel.queueDeclare(queueOutputName, true, false, false, null);
if(queueOkStatus.getMessageCount()==0){//your logic here}`
but be careful, because this method returns number of non-acked messages in queue.
If you want to be aware of this , you can check Q count before inserting. It sends request on the same channel. Asserting Q returns messageCount which is Number of 'Ready' Messages. Note : This does not include the messages in unAcknowledged state.
If you do not wish to be aware of the Q length, then as specified in 1st comment of the question:
x-max-length :
How many (ready) messages a queue can contain before it starts to drop them from its head.
(Sets the "x-max-length" argument.)

From where I can increase the default max deffer limit value in cpanel?

I am having a cPanel server ,
getting this error while sending the email .
Domain XYZ.com has exceeded the max defers and failures per hour (5/5 (100%)) allowed. Message discarded.
Also the maximum email sending limit is set to 500 in the tweak setting and the account package .
From where I can increase the default max deffer limit value in cpanel .
Thanks
On the tweak settings page, there is an option under the mail tab for:
Number of failed or deferred messages a domain may send before protections can be triggered

How to get priority of current job?

In beanstalkd
telnet localhost 11300
USING foo
put 0 100 120 5
hello
INSERTED 1
How can I know what is the priority of this job when I reserve it? And can I release it by making the new priority equals to current priority +100?
Beanstalkd doesn't return the priority with the data - but you could easily add it as metadata in your own message body. for example, with Json as a message wrapper:
{'priority':100,'timestamp':1302642381,'job':'download http://example.com/'}
The next message that will be reserved will be the next available entry from the selected tubes, according to priority and time - subject to any delay that you had requested when you originally sent the message to the queue.
Addition: You can get the priority of a beanstalk job (as well as a number of other pieces of information, such as how many times it has previously been reserved), but it's an additional call - to the stats-job command. Called with the jobId, it returns about a dozen different pieces of information. See the protocol document, and your libraries docs.