Skip to content

Commit

Permalink
CAMEL-20406: Route scoped variables
Browse files Browse the repository at this point in the history
  • Loading branch information
davsclaus committed Feb 11, 2024
1 parent 3b5075d commit 6cf17ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ static void setVariableProperties(
id = "route";
key = key.substring(6);
key = StringHelper.replaceFirst(key, ".", ":");
} else if (key.startsWith("global.")) {
id = "global";
key = key.substring(7);
key = StringHelper.replaceFirst(key, ".", ":");
}
VariableRepository repo = camelContext.getCamelContextExtension().getContextPlugin(VariableRepositoryFactory.class)
.getVariableRepository(id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class MainVariableTest {
public void testMainVariableParameters() throws Exception {
Main main = new Main();

main.addInitialProperty("camel.variable.global:greeting", "Random number");
main.addInitialProperty("camel.variable.global.greeting", "Random number");
// global is default
main.addInitialProperty("camel.variable.random", "999");

Expand Down

0 comments on commit 6cf17ad

Please sign in to comment.