Skip to content

Made Baggage mutable, to allow for extension.#23450

Closed
beskow wants to merge 1 commit into
apache:mainfrom
beskow:CAMEL-23349-OpenTelemetrySpanAdapter-mutable-Baggage
Closed

Made Baggage mutable, to allow for extension.#23450
beskow wants to merge 1 commit into
apache:mainfrom
beskow:CAMEL-23349-OpenTelemetrySpanAdapter-mutable-Baggage

Conversation

@beskow
Copy link
Copy Markdown
Contributor

@beskow beskow commented May 22, 2026

Description

Made Baggage mutable, i.e. non-private and with a setter.

This allows for extending the Baggage with additional entries, which may be valuable for low-level programmatic baggage management when the generic solution (https://camel.apache.org/components/next/others/opentelemetry2.html#_baggage_customization) isn't sufficient.

For more details, see discussion in https://issues.apache.org/jira/projects/CAMEL/issues/CAMEL-23349

Target

  • I checked that the commit is targeting the correct branch (Camel 4 uses the main branch)

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

Apache Camel coding standards and style

  • I checked that each commit in the pull request has a meaningful subject line and body.

  • I have run mvn clean install -DskipTests locally from root folder and I have committed all auto-generated changes.

@apupier apupier requested a review from squakez May 22, 2026 07:18
@github-actions
Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions
Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • components/camel-opentelemetry2
All tested modules (9 modules)
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Launcher :: Container
  • Camel :: Observability Services
  • Camel :: Opentelemetry 2
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

Copy link
Copy Markdown
Contributor

@squakez squakez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, we must decline it. This is against the design of the Span adapter that is meant to be immutable. We could break consistency in async Camel core logic processing if we let the final user to mess it up with the telemetry logic. The telemetry logic MUST be exclusive scope of core and we are limiting that with clear design decisions.

If you need something different of what it is proposed by the framework, I suggest to avoid using it at all and, instead, develop something specific to your used case. Camel is a large and complex framework and there are different ways to manage some specific problem, customization included.

@beskow
Copy link
Copy Markdown
Contributor Author

beskow commented May 22, 2026

Ok, no problem. We can live with the sub-route workaround. Thanks anyway!

@beskow beskow closed this May 22, 2026
@beskow beskow deleted the CAMEL-23349-OpenTelemetrySpanAdapter-mutable-Baggage branch May 22, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants