You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2019/10/16 08:40:31 UTC
[camel-quarkus] branch master updated: fix(build): Handle loading
routes from XML with latest camel SNAPSHOT
This is an automated email from the ASF dual-hosted git repository.
lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/master by this push:
new 2d8223b fix(build): Handle loading routes from XML with latest camel SNAPSHOT
2d8223b is described below
commit 2d8223b5eea9cccdd30d258203cd9385f3249bef
Author: James Netherton <ja...@gmail.com>
AuthorDate: Wed Oct 16 08:04:33 2019 +0100
fix(build): Handle loading routes from XML with latest camel SNAPSHOT
---
.../java/org/apache/camel/quarkus/core/CamelMainRecorder.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainRecorder.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainRecorder.java
index 3ca6435..3b79c45 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainRecorder.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainRecorder.java
@@ -27,6 +27,8 @@ import org.apache.camel.RoutesBuilder;
import org.apache.camel.impl.engine.DefaultReactiveExecutor;
import org.apache.camel.main.MainListener;
import org.apache.camel.model.Model;
+import org.apache.camel.model.ModelHelper;
+import org.apache.camel.model.RoutesDefinition;
import org.apache.camel.spi.ReactiveExecutor;
import org.apache.camel.support.ResourceHelper;
import org.apache.camel.util.ObjectHelper;
@@ -81,8 +83,10 @@ public class CamelMainRecorder {
if (ObjectHelper.isNotEmpty(location)) {
// TODO: if pointing to a directory, we should load all xmls in it
// (maybe with glob support in it to be complete)
- try (InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(main.getValue().getCamelContext(), location)) {
- main.getValue().getCamelContext().getExtension(Model.class).addRouteDefinitions(is);
+ CamelContext camelContext = main.getValue().getCamelContext();
+ try (InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(camelContext, location)) {
+ RoutesDefinition routes = ModelHelper.loadRoutesDefinition(camelContext, is);
+ camelContext.getExtension(Model.class).addRouteDefinitions(routes.getRoutes());
} catch (Exception e) {
throw new RuntimeException(e);
}