Claus Ibsen created CAMEL-27885:
-----------------------------------
Summary: camel-jms: deliveryDelay and the endpoint QoS are ignored
with preserveMessageQos, consumerType=Simple always uses a thread pool
Key: CAMEL-27885
URL: https://issues.apache.org/jira/browse/CAMEL-27885
Project: Camel
Issue Type: Bug
Components: camel-jms
Reporter: Claus Ibsen
Fix For: 4.25.0
Found while improving the option descriptions of camel-jms for CAMEL-23832
(pull request https://github.com/apache/camel/pull/31155).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. deliveryDelay is ignored with preserveMessageQos
In {{JmsConfiguration.CamelJmsTemplate.doSend}}, the preserveMessageQos branch
calls producer.send(message, mode, priority, ttl) without
producer.setDeliveryDelay(...), which only super.doSend of Spring JmsTemplate
applies.
Proposed change: set the delivery delay in that branch too.
h4. 2. preserveMessageQos does not fall back to the endpoint QoS
Without a JMSDeliveryMode header, doSend uses message.getJMSDeliveryMode(),
which {{JmsBinding.createJmsMessage}} always sets to PERSISTENT, so
deliveryPersistent=false and deliveryMode=1 are ignored; without a JMSPriority
header the provider default priority of the message is used instead of the
endpoint priority.
Proposed change: fall back to getDeliveryMode()/getPriority() of the template
when no header was given.
h4. 3. consumerType=Simple always runs the route in a thread pool
{{JmsEndpoint.configureListenerContainer}} sets a Camel cached thread pool as
the taskExecutor of every SimpleMessageListenerContainer when none is
configured. Spring then hands each message to that executor, and per its
Javadoc the message is acknowledged before the listener runs, with "unspecified
results" for transacted or CLIENT_ACKNOWLEDGE sessions.
Proposed change: do not set a default executor on
SimpleMessageListenerContainer.
h4. 4. idleReceivesPerTaskLimit check in the reply managers
TemporaryQueueReplyManager and QueueReplyManager check
getIdleReceivesPerTaskLimit() != 0, but the unset value is Integer.MIN_VALUE
(harmless today, as it is also the Spring unset value).
Proposed change: use the same check as JmsConfiguration.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)