This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new cdaf5a8b8b4c CAMEL-19807: Deprecate legacy Spring/Blueprint XML
parsing in camel-xml-io
cdaf5a8b8b4c is described below
commit cdaf5a8b8b4c7eb8ffa32911d3995b6bbc2b3575
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Jul 6 13:03:59 2026 +0200
CAMEL-19807: Deprecate legacy Spring/Blueprint XML parsing in camel-xml-io
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
---
.../main/java/org/apache/camel/model/app/BeansDefinition.java | 10 ++++++++++
.../org/apache/camel/dsl/xml/io/XmlRoutesBuilderLoader.java | 9 ++++++++-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git
a/core/camel-core-model/src/main/java/org/apache/camel/model/app/BeansDefinition.java
b/core/camel-core-model/src/main/java/org/apache/camel/model/app/BeansDefinition.java
index f10ac0db31a0..ad2cc3f95859 100644
---
a/core/camel-core-model/src/main/java/org/apache/camel/model/app/BeansDefinition.java
+++
b/core/camel-core-model/src/main/java/org/apache/camel/model/app/BeansDefinition.java
@@ -142,10 +142,20 @@ public class BeansDefinition {
this.beans = beans;
}
+ /**
+ * @deprecated use standard Camel XML DSL (camel-xml-io) instead of legacy
Spring/Blueprint XML.
+ * This feature will be removed in a future release.
+ */
+ @Deprecated(since = "4.22")
public List<Element> getSpringOrBlueprintBeans() {
return springOrBlueprintBeans;
}
+ /**
+ * @deprecated use standard Camel XML DSL (camel-xml-io) instead of legacy
Spring/Blueprint XML.
+ * This feature will be removed in a future release.
+ */
+ @Deprecated(since = "4.22")
public void setSpringOrBlueprintBeans(List<Element>
springOrBlueprintBeans) {
this.springOrBlueprintBeans = springOrBlueprintBeans;
}
diff --git
a/dsl/camel-xml-io-dsl/src/main/java/org/apache/camel/dsl/xml/io/XmlRoutesBuilderLoader.java
b/dsl/camel-xml-io-dsl/src/main/java/org/apache/camel/dsl/xml/io/XmlRoutesBuilderLoader.java
index fcf6edc8815c..1c07e3b8a49f 100644
---
a/dsl/camel-xml-io-dsl/src/main/java/org/apache/camel/dsl/xml/io/XmlRoutesBuilderLoader.java
+++
b/dsl/camel-xml-io-dsl/src/main/java/org/apache/camel/dsl/xml/io/XmlRoutesBuilderLoader.java
@@ -78,6 +78,7 @@ public class XmlRoutesBuilderLoader extends
RouteBuilderLoaderSupport {
private final List<BeanFactoryDefinition<?>> delayedRegistrations = new
ArrayList<>();
private final AtomicInteger counter = new AtomicInteger(0);
+ private volatile boolean springBlueprintWarned;
public XmlRoutesBuilderLoader() {
super(EXTENSION);
@@ -392,7 +393,13 @@ public class XmlRoutesBuilderLoader extends
RouteBuilderLoaderSupport {
// <s:bean>, <s:beans> and <s:alias> elements - all the elements in
single BeansDefinition have
// one parent org.w3c.dom.Document - and this is what we collect from
each resource
- if (!app.getSpringOrBlueprintBeans().isEmpty()) {
+ if (!app.getSpringOrBlueprintBeans().isEmpty()) { // NOSONAR
+ if (!springBlueprintWarned) {
+ springBlueprintWarned = true;
+ LOG.warn(
+ "Detected legacy Spring <beans> or OSGi <blueprint>
XML. This feature is deprecated and will be removed in a future release."
+ + " Migrate to standard Camel XML DSL
(camel-xml-io).");
+ }
Document doc =
app.getSpringOrBlueprintBeans().get(0).getOwnerDocument();
String ns = doc.getDocumentElement().getNamespaceURI();
String id = null;