This is an automated email from the ASF dual-hosted git repository. pcongiusti pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit b353334e5fe6ab31a0d240c21c70152b6d882951 Author: Pasquale Congiusti <[email protected]> AuthorDate: Tue Mar 10 10:31:52 2026 +0100 chore(api): mark deprecated usage of OTEL constants --- .../main/java/org/apache/camel/component/direct/DirectProducer.java | 1 + core/camel-api/src/main/java/org/apache/camel/Exchange.java | 2 ++ .../camel-api/src/main/java/org/apache/camel/ExchangePropertyKey.java | 4 ++++ .../src/main/java/org/apache/camel/saga/InMemorySagaCoordinator.java | 1 + 4 files changed, 8 insertions(+) diff --git a/components/camel-direct/src/main/java/org/apache/camel/component/direct/DirectProducer.java b/components/camel-direct/src/main/java/org/apache/camel/component/direct/DirectProducer.java index 721e86b0eca8..ecd3a9cf70aa 100644 --- a/components/camel-direct/src/main/java/org/apache/camel/component/direct/DirectProducer.java +++ b/components/camel-direct/src/main/java/org/apache/camel/component/direct/DirectProducer.java @@ -96,6 +96,7 @@ public class DirectProducer extends DefaultAsyncProducer { } else { //Ensure we can close the CLIENT Scope created by this DirectProducer //in the same thread + // Deprecated in 4.19.0 if (exchange.getProperty(ExchangePropertyKey.OTEL_ACTIVE_SPAN) != null) { exchange.setProperty(ExchangePropertyKey.OTEL_CLOSE_CLIENT_SCOPE, Boolean.TRUE); } diff --git a/core/camel-api/src/main/java/org/apache/camel/Exchange.java b/core/camel-api/src/main/java/org/apache/camel/Exchange.java index 690521064693..55ec9532b582 100644 --- a/core/camel-api/src/main/java/org/apache/camel/Exchange.java +++ b/core/camel-api/src/main/java/org/apache/camel/Exchange.java @@ -315,7 +315,9 @@ public interface Exchange extends VariableAware { String XSLT_WARNING = "CamelXsltWarning"; // special for camel-tracing/open-telemetry + @Deprecated(since = "4.19.0") String OTEL_ACTIVE_SPAN = "OpenTracing.activeSpan"; + @Deprecated(since = "4.19.0") String OTEL_CLOSE_CLIENT_SCOPE = "OpenTracing.closeClientScope"; /** diff --git a/core/camel-api/src/main/java/org/apache/camel/ExchangePropertyKey.java b/core/camel-api/src/main/java/org/apache/camel/ExchangePropertyKey.java index 3c75d3794e4b..491a48f3a2d0 100644 --- a/core/camel-api/src/main/java/org/apache/camel/ExchangePropertyKey.java +++ b/core/camel-api/src/main/java/org/apache/camel/ExchangePropertyKey.java @@ -85,7 +85,9 @@ public enum ExchangePropertyKey { TRY_ROUTE_BLOCK(Exchange.TRY_ROUTE_BLOCK), UNIT_OF_WORK_EXHAUSTED(Exchange.UNIT_OF_WORK_EXHAUSTED), // special for camel-tracing/open-telemetry + @Deprecated(since = "4.19.0") OTEL_ACTIVE_SPAN(Exchange.OTEL_ACTIVE_SPAN), + @Deprecated(since = "4.19.0") OTEL_CLOSE_CLIENT_SCOPE(Exchange.OTEL_CLOSE_CLIENT_SCOPE); private final String name; @@ -218,8 +220,10 @@ public enum ExchangePropertyKey { return TRY_ROUTE_BLOCK; case Exchange.UNIT_OF_WORK_EXHAUSTED: return UNIT_OF_WORK_EXHAUSTED; + // Deprecated since 4.19.0 case Exchange.OTEL_ACTIVE_SPAN: return OTEL_ACTIVE_SPAN; + // Deprecated since 4.19.0 case Exchange.OTEL_CLOSE_CLIENT_SCOPE: return OTEL_CLOSE_CLIENT_SCOPE; default: diff --git a/core/camel-support/src/main/java/org/apache/camel/saga/InMemorySagaCoordinator.java b/core/camel-support/src/main/java/org/apache/camel/saga/InMemorySagaCoordinator.java index 067744af5369..8b6ba4599ee3 100644 --- a/core/camel-support/src/main/java/org/apache/camel/saga/InMemorySagaCoordinator.java +++ b/core/camel-support/src/main/java/org/apache/camel/saga/InMemorySagaCoordinator.java @@ -228,6 +228,7 @@ public class InMemorySagaCoordinator implements CamelSagaCoordinator { }); } + @SuppressWarnings("deprecation") private Exchange createExchange(Exchange parent, Endpoint endpoint, CamelSagaStep step) { Exchange answer = endpoint.createExchange(); answer.getMessage().setHeader(Exchange.SAGA_LONG_RUNNING_ACTION, getId());
