You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Luca Burgazzoli (Jira)" <ji...@apache.org> on 2020/07/19 13:26:00 UTC
[jira] [Created] (CAMEL-15313) camel-core - Parameterized
RouteBuilder - add routes while starting the camel context
Luca Burgazzoli created CAMEL-15313:
---------------------------------------
Summary: camel-core - Parameterized RouteBuilder - add routes while starting the camel context
Key: CAMEL-15313
URL: https://issues.apache.org/jira/browse/CAMEL-15313
Project: Camel
Issue Type: Improvement
Components: camel-core
Reporter: Luca Burgazzoli
Fix For: 3.5.0
Working to create a camel-kamelet component here: https://github.com/apache/camel-k-runtime/issues/375 and there is an issue when the routes templates are materialized:
Assuming I have a route template defines as:
{code:java}
routeTemplate("setBody")
.templateParameter("bodyValue")
.from("direct:{{routeId}}")
.setBody().constant("{{bodyValue}}");
{code}
And a route like:
{code:java}
from("direct:template")
.to("kamelet:setBody/test?bodyValue=bv")
.to("log:template");
{code}
Then the kamelet component would try to create a route named test out of the setBody template and:
1. if the route is create upon KameletComponent::createEndpoint, then the camel context would fails to materialize the template as there is a concurrent exception because a new route definition is added while the context is iterating over them
2. if the route is created upon KameletEndpoint::onStart, then the route is not added to the camel context
--
This message was sent by Atlassian Jira
(v8.3.4#803005)