[
https://issues.apache.org/jira/browse/CAMEL-16850?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Zoran Regvart updated CAMEL-16850:
----------------------------------
Description:
The {{MainBootstrapCloseable}} clears and sets to {{null}} initial properties,
override properties wildcard properties and main configuration properties on
bootstrap of Camel context. Adding a route that depends on those properties
after bootstrap is therefore no longer possible.
The value {{MainBootstrapCloseable}} has in static route configurations is at
odds in dynamic route configurations.
Example (obviously not production code):
{code:java}
final Main main = new Main();main.addInitialProperty("prop", "value");
try (MainConfigurationProperties conf = main.configure()) {
conf.addRoutesBuilder(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("timer:one").log("{{prop}}").process(e ->
e.getContext().addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("timer:two").log("{{prop}}");
}
}));
}
});
main.run();
} {code}
Should the {{MainBootstrapCloseable}} be removed, or should the properties
component be configured to incorporate these properties?
was:
The {{MainBootstrapCloseable}} clears and sets to {{null}} initial properties,
override properties wildcard properties and main configuration properties on
bootstrap of Camel context. Adding a route that depends on those properties
after bootstrap is therefore no longer possible.
The value {{MainBootstrapCloseable}} has in static route configurations is at
odds in dynamic route configurations.
Example (obviously not production code):
{code:java}
final Main main = new Main();main.addInitialProperty("prop", "value");
try (MainConfigurationProperties conf = main.configure()) {
conf.addRoutesBuilder(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("timer:one").log("{{prop}}").process(e ->
e.getContext().addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("timer:two").log("{{prop}}");
}
}));
}
}); main.run();
} {code}
Should the {{MainBootstrapCloseable}} be removed, or should the properties
component be configured to incorporate these properties?
> Unable to reference properties after bootstrap
> ----------------------------------------------
>
> Key: CAMEL-16850
> URL: https://issues.apache.org/jira/browse/CAMEL-16850
> Project: Camel
> Issue Type: Bug
> Components: camel-main
> Affects Versions: 3.11.0
> Reporter: Zoran Regvart
> Priority: Major
>
> The {{MainBootstrapCloseable}} clears and sets to {{null}} initial
> properties, override properties wildcard properties and main configuration
> properties on bootstrap of Camel context. Adding a route that depends on
> those properties after bootstrap is therefore no longer possible.
> The value {{MainBootstrapCloseable}} has in static route configurations is at
> odds in dynamic route configurations.
> Example (obviously not production code):
> {code:java}
> final Main main = new Main();main.addInitialProperty("prop", "value");
> try (MainConfigurationProperties conf = main.configure()) {
> conf.addRoutesBuilder(new RouteBuilder() {
> @Override
> public void configure() throws Exception {
> from("timer:one").log("{{prop}}").process(e ->
> e.getContext().addRoutes(new RouteBuilder() {
> @Override
> public void configure() throws Exception {
> from("timer:two").log("{{prop}}");
> }
> }));
> }
> });
> main.run();
> } {code}
> Should the {{MainBootstrapCloseable}} be removed, or should the properties
> component be configured to incorporate these properties?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)