While running the app in consumer mode, my application is frequently crashing with an error Error: Channel closed by server: 406 (PRECONDITION-FAILED) with message "PRECONDITION_FAILED - inequivalent arg 'x-max-priority' for queue 'xyz' in vhost '/': received the value '10' of type 'byte' but current is none"
. Does anyone know the fix for this issue?
@here Deleting the queue 'xyz' worked for me.
It appears that you're making a call to a server that requires one or more preconditions to be met before it will return a result. Since this is a remote server call, you'd need to check the API documentation to determine what precondition(s) is/are required, or if there is no API documentation, contact the manager of the server in question.
See 406 HTTP "Not Acceptable" Status Code for more about this particular error.
406 (PRECONDITION-FAILED)
refers to an AMQP status rather than an HTTP status (which also has a different code "Not Acceptable") –
Guillerminaguillermo While the exception of assertQueue still exists, but I found that I don't need to run assertqueue before consuming .. so for now I just commented the assertQueue call. and consuming is working.
I don't know why all examples of ameplib run assertQueue before anything?!
406 ERROR also may occur if the queueNamed channel is acknowledeged more than once, Make sure channel ack type is set to manual, {noAck: false}. this closes the queueChannel which causes the consumer/publisher to not be able to access the queueChannel.
Note: Make sure you ack the queue in the same order it is received by the system. If your handling many publishers and consumers in single functionality also check if you have pre acked the channel.
© 2022 - 2024 — McMap. All rights reserved.
x-max-priority
: 10. Deleting the queue worked for me. – Pteridology