Federico Mariani created CAMEL-27119:
----------------------------------------

             Summary: camel-jms, camel-sjms - the consumer ignores 
exceptionHandler, and the errors of a request timeout and of a missing 
connection factory do not say why
                 Key: CAMEL-27119
                 URL: https://issues.apache.org/jira/browse/CAMEL-27119
             Project: Camel
          Issue Type: Bug
          Components: camel-jms, camel-sjms
            Reporter: Federico Mariani


Three problems of the jms component (the first also of sjms).

*1. Request timeout.* A producer that sends an InOut exchange and gets no reply 
fails with:
{noformat}
The OUT message was not received within: 20000 millis due reply message with 
correlationID: Camel-... not received on destination: 
ActiveMQTemporaryQueue[...]. Exchange[...]
{noformat}
It does not say that the producer waited because the exchange is InOut, as is 
an exchange from an HTTP or REST consumer, from a JMS message with a 
{{JMSReplyTo}}, or from a {{request}} method of {{ProducerTemplate}}, nor how 
to send without waiting:
{code:java}
from("platform-http:/orders").to("jms:queue:orders"); // nothing replies: fails 
after requestTimeout
{code}
camel-sjms gives the same text.

*2. Missing connection factory.* When no connection factory is set and the 
registry has none, or several (so the component does not autowire one), a 
consumer fails at startup, and a producer at its first message, with a bare 
{{connectionFactory must be specified}}. It names neither the endpoint nor the 
reason. With several beans, the reason is only logged at DEBUG ({{Cannot 
autowire ConnectionFactory as 2 instances found in registry.}}), without the 
bean names.
{code:java}
context.getRegistry().bind("cf1", cf1);
context.getRegistry().bind("cf2", cf2);
from("jms:queue:orders").to("log:orders"); // IllegalArgumentException: 
connectionFactory must be specified
{code}

*3. exceptionHandler.* The consumer option {{exceptionHandler}} (listed in the 
catalog) is never used: the JMS exceptions of the listener container, such as a 
connection to the broker that cannot be established, go only to 
{{exceptionListener}} and to the log.
{code:java}
from("jms:queue:orders?exceptionHandler=#myHandler").to("log:orders"); // 
broker down: myHandler is never called
{code}
{{bridgeErrorHandler=true}} fails with {{BridgeErrorHandler is not support on 
JMS endpoint}}, which does not say what to use.

Expected:
* The timeout message keeps its text and adds why the producer waited (the 
exchange is InOut) and what to do: check that a consumer of the request 
destination replies, or increase {{requestTimeout}}; if no reply is expected, 
send with {{exchangePattern=InOnly}} or {{disableReplyTo=true}}. Same text in 
camel-sjms.
* The connection factory message keeps its prefix and names the component, the 
endpoint, and why none was autowired: no bean, several beans (with their 
names), {{allowAutoWiredConnectionFactory=false}}, or a {{transactionManager}}. 
The autowiring does not change.
* The consumer gives the JMS exceptions of its listener container to the 
{{exceptionHandler}} when it is set, after the {{exceptionListener}}. The 
bridgeErrorHandler message says to use these options.

_Claude Code on behalf of Federico Mariani_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to