Claus Ibsen created CAMEL-25767:
-----------------------------------
Summary: camel-jbang - camel run --dev: a reload does not apply
new camel.beans and camel.component properties
Key: CAMEL-25767
URL: https://issues.apache.org/jira/browse/CAMEL-25767
Project: Camel
Issue Type: Improvement
Components: camel-jbang
Reporter: Claus Ibsen
Fix For: 4.24.0
In camel run --dev, a change to application.properties is reloaded, but new
bean and component settings in it are not applied. For example, adding a JMS
connection to a running application:
{code}
camel.beans.artemisCF =
#class:org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory
camel.beans.artemisCF.brokerURL = tcp://localhost:61616
camel.beans.artemisCF.user = artemis
camel.beans.artemisCF.password = artemis
camel.component.jms.connection-factory = #bean:artemisCF
{code}
together with a route that uses jms, written in the same save. The reload
creates the jms component without the connection factory:
{noformat}
FailedToStartRouteException: Failed to start route: reserve-order (source:
jms-request-reply.camel.yaml:31) because: connectionFactory must be specified
{noformat}
After a restart, the same files work. The reload updates the values of property
placeholders, but camel.beans.* and camel.component.* are applied only when the
application starts. A user or a coding agent that adds a connection this way
gets an error that points at the route, not at the reload.
Proposal: on a reload, apply new camel.beans.* properties (create the bean, and
download the dependency of its class as at startup) and the camel.component.*
properties of components that are not created yet. Where that is not possible,
log that these properties need a restart.
Found while adding a JMS example to the AI benchmark
(apache/camel-jbang-examples#115).
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)