Claus Ibsen created CAMEL-27672:
-----------------------------------
Summary: camel-sjms2: durable/shared silently ignored without
subscriptionId, clientId doc text
Key: CAMEL-27672
URL: https://issues.apache.org/jira/browse/CAMEL-27672
Project: Camel
Issue Type: Bug
Components: camel-sjms2
Reporter: Claus Ibsen
Fix For: 4.24.0
Found while improving the option descriptions of camel-sjms2 for CAMEL-23832
(commit
https://github.com/apache/camel/commit/50636600967ffd85ced09369be30b29699c23218).
These are separate problems of the component; the descriptions commit only
documents the current behavior.
h4. 1. durable and shared are silently ignored without a subscription name
On a topic consumer, {{Jms2ObjectFactory.createTopicMessageConsumer()}} checks
{{subscriptionId}} first. When it is empty, it calls
{{createSubscriptionlessTopicConsumer()}}, whatever {{durable}} and {{shared}}
say. So {{sjms2:topic:foo?durable=true}} or {{sjms2:topic:foo?shared=true}}
(without {{subscriptionId}} or {{durableSubscriptionName}}) starts a plain
non-durable, non-shared consumer, with no warning or error. The user only
notices when messages sent while the route is stopped are lost, or when every
consumer gets every message.
Proposed change: fail at endpoint or consumer start (or at least log a WARN)
when {{durable}} or {{shared}} is true on a topic and no subscription name is
set.
h4. 2. durableSubscriptionName text says clientId is required, also for a
shared subscription
The text of {{durableSubscriptionName}} comes from {{SjmsEndpoint}} in
camel-sjms: "The durable subscriber name for specifying durable topic
subscriptions. The clientId option must be configured as well." In sjms2,
{{Sjms2Endpoint.setDurableSubscriptionName()}} sets {{subscriptionId}} and
{{durable=true}}; with {{shared=true}} the consumer calls
{{Session.createSharedDurableConsumer()}}, which does not need a client ID.
Proposed change: say in the camel-sjms text that the client ID is needed for an
unshared durable subscription, or override the text for sjms2.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)