Claus Ibsen created CAMEL-27873:
-----------------------------------
Summary: camel-spring-rabbitmq: rejectAndDontRequeue=false drops
the message, retryDelay cannot be 0, generated queues are durable
Key: CAMEL-27873
URL: https://issues.apache.org/jira/browse/CAMEL-27873
Project: Camel
Issue Type: Bug
Components: camel-spring-rabbitmq
Reporter: Claus Ibsen
Fix For: 4.25.0
Found while improving the option descriptions of camel-spring-rabbitmq for
CAMEL-23832 (pull request https://github.com/apache/camel/pull/31149).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. rejectAndDontRequeue=false drops the message
{{DefaultListenerContainerFactory.createListenerContainer}} sets no recoverer
when rejectAndDontRequeue=false; after the retries the Spring retry interceptor
logs WARN "Message(s) dropped on recovery" and the message is acknowledged
(AUTO) and lost, although the option name suggests it is requeued.
Proposed change: use ImmediateRequeueMessageRecoverer when false, or rename the
option.
h4. 2. retryDelay 0 still waits 1 second
When retryDelay <= 0, backOffOptions is not called, so the default delay of the
Spring RetryPolicy (1000 ms) applies and the delay cannot be turned off.
Proposed change: configure delay(Duration.ZERO) for 0.
h4. 3. Generated queues are durable and not auto-delete
Without the queues option, {{SpringRabbitMQEndpoint.declareElements}} declares
a queue with a generated name that is durable and not auto-delete (consumer,
and producer with autoDeclareProducer). Each start leaves another durable queue
bound to the exchange that keeps collecting messages after the application
stops.
Proposed change: declare generated queues like Spring AnonymousQueue
(non-durable, exclusive, auto-delete).
h4. 4. skipDeclareQueue still binds a queue without a name
With skipDeclareQueue=true and no queues, the queue name is "" and is not
declared, but is still bound unless skipBindQueue=true.
Proposed change: skip the binding when the queue has no name and was not
declared.
h4. 5. x-priority is not converted to a number
{{SpringRabbitMQEndpoint.prepareArgs}} converts x-max-length, x-message-ttl and
similar to numbers, but not the consumer argument x-priority, so
arg.consumer.x-priority=5 is sent as a String (not tested against a broker).
Proposed change: convert x-priority to an Integer.
h4. 6. Dead-letter args lookup on prefixed keys
declareElements calls parseArgsString(args,
"x-dead-letter-exchange"/"x-dead-letter-routing-key") on the endpoint-wide map
whose keys are prefixed (queue.x-...), so it almost never matches and removes
entries from the endpoint args.
Proposed change: look up the prefixed keys on a copy.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)