CAMEL-18057: rest-dsl - Combine rest and linked route together as single route
diff --git a/components-starter/camel-core-starter/src/main/docs/core.json b/components-starter/camel-core-starter/src/main/docs/core.json
index 9e448f0..d713fb9 100644
--- a/components-starter/camel-core-starter/src/main/docs/core.json
+++ b/components-starter/camel-core-starter/src/main/docs/core.json
@@ -712,6 +712,13 @@
"sourceType": "org.apache.camel.model.rest.springboot.RestConfigurationDefinitionProperties"
},
{
+ "name": "camel.rest.inline-routes",
+ "type": "java.lang.Boolean",
+ "description": "Inline routes in rest-dsl which are linked using direct endpoints. By default, each service in Rest DSL is an individual route, meaning that you would have at least two routes per service (rest-dsl, and the route linked from rest-dsl). Enabling this allows Camel to optimize and inline this as a single route, however this requires to use direct endpoints, which must be unique per service. This option is default false.",
+ "sourceType": "org.apache.camel.model.rest.springboot.RestConfigurationDefinitionProperties",
+ "defaultValue": false
+ },
+ {
"name": "camel.rest.json-data-format",
"type": "java.lang.String",
"description": "Name of specific json data format to use. By default jackson will be used. Important: This option is only for setting a custom name of the data format, not to refer to an existing data format instance.",
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/model/rest/springboot/RestConfigurationDefinitionProperties.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/model/rest/springboot/RestConfigurationDefinitionProperties.java
index fba7fea..30ad14d 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/model/rest/springboot/RestConfigurationDefinitionProperties.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/model/rest/springboot/RestConfigurationDefinitionProperties.java
@@ -146,6 +146,15 @@
*/
private Boolean enableCors = false;
/**
+ * Inline routes in rest-dsl which are linked using direct endpoints. By
+ * default, each service in Rest DSL is an individual route, meaning that
+ * you would have at least two routes per service (rest-dsl, and the route
+ * linked from rest-dsl). Enabling this allows Camel to optimize and inline
+ * this as a single route, however this requires to use direct endpoints,
+ * which must be unique per service. This option is default false.
+ */
+ private Boolean inlineRoutes = false;
+ /**
* Name of specific json data format to use. By default jackson will be
* used. Important: This option is only for setting a custom name of the
* data format, not to refer to an existing data format instance.
@@ -328,6 +337,14 @@
this.enableCors = enableCors;
}
+ public Boolean getInlineRoutes() {
+ return inlineRoutes;
+ }
+
+ public void setInlineRoutes(Boolean inlineRoutes) {
+ this.inlineRoutes = inlineRoutes;
+ }
+
public String getJsonDataFormat() {
return jsonDataFormat;
}