Loading

Anypoint MQ ACK operation fails with the error - 404 Queue cannot be found and Error type - ANYPOINT-MQ:DESTINATION_NOT_FOUND

Date de publication: Nov 6, 2024
Description

The Anypoint MQ ACK operation intermittently returns the following error:

  • Cause: 404 - Not Found
  • StatusMessage: Queue cannot be found
  • Error type: ANYPOINT-MQ:DESTINATION_NOT_FOUND

Additionally, the exception stack trace contains no information on the root cause.

ERROR OnErrorPropagateHandler [[MuleRuntime].uber.123: [test-anypoint-mq-messaging].uber@com.mulesoft.extension.mq.internal.connection.AnypointMQConnectionProvider.connect:122 @537dd9ab]: 
********************************************************************************
Message               : Failed to ACK the message with id 'abcde12f-34g5-67h8-9ij0-k12345678901': An error occurred while executing the operation: ACK ONE MESSAGE. Cause: 404 - Not Found ({
  "status" : "failure",
  "statusMessage" : "Queue cannot be found"
}).
Element               : message-process/processors/1/processors/3 @ test-anypoint-mq-messaging:process.xml:40 (Ack)
Element DSL           : <anypoint-mq:ack doc:name="Ack" config-ref="Anypoint_MQ_Config" ackToken="#[vars.ackToken]"></anypoint-mq:ack>
Error type            : ANYPOINT-MQ:DESTINATION_NOT_FOUND
FlowStack             : at flow-dequeue-message-email(message-process/processors/1/processors/3 @ test-anypoint-mq-messaging:process.xml:40 (Ack))
Payload Type          : org.mule.runtime.core.internal.streaming.bytes.ManagedCursorStreamProvider
--------------------------------------------------------------------------------
Root Exception stack trace:
com.mulesoft.mq.restclient.exception.ResourceNotFoundException: An error occurred while executing the operation: ACK ONE MESSAGE. Cause: 404 - Not Found ({
  "status" : "failure",
  "statusMessage" : "Queue cannot be found"
}).

CAUSE

The 404 Not found error occurs when the message Acknowledgement Timeout is reached before the ACK operation is executed in the flow. In such cases, the message is sent back to the same queue for consumption by the Subscriber listener. If Acknowledgement Timeout is not set, Anypoint MQ Connector defaults to two minutes. Refer to the documentation on Anypoint MQ Acknowledgement Timeout.

Additionally, if this queue is assigned a Dead Letter Queue (DLQ), the above scenario might repeat until the "Delivery attempts before reroute" count is met, after which the message will be moved to the DLQ. Refer to the documentation on Anypoint MQ Dead Letter Queues (DLQ).

This situation can occur if a high number of messages are being processed in the Subscriber flow without Max Concurrency configured, which could cause a delay in reaching the ACK operation within the Acknowledgement Timeout.

 

Résolution

The solution to this error should be approached as a performance-tuning exercise. Follow the suggestions below and perform a load test to identify the appropriate values to configure:

  1. Add a Max Concurrency value to the flow: This will restrict the number of messages processed simultaneously. The value should be determined by considering factors such as the expected volume of messages, the time taken to process a single message, and the expected time to complete processing all messages. For FIFO, we recommend setting maxConcurency to 1 as per knowledge article Anypoint MQ FIFO Queue Message is not in order if maxConcurrency is not 1.
  2. Increase the Acknowledgement Timeout value: Adjust the default 2-minute timeout to a higher value (i.e 3 or 5 mins). However, ensure that the value is not set too high, as this could have adverse effects. Please refer to KB here for the impact of setting an excessively high acknowledgment timeout.

Additionally, adding a logger component immediately after the Subscriber listener and right before the ACK operation will help analyze the time taken for a message to enter the flow and reach the ACK operation.

Numéro d’article de la base de connaissances

003714001

 
Chargement
Salesforce Help | Article