Skip to content

CAMEL-23063: Add camel-a2a component for Agent-to-Agent (A2A) protoco…#23711

Open
luigidemasi wants to merge 6 commits into
apache:mainfrom
luigidemasi:CAMEL-23063
Open

CAMEL-23063: Add camel-a2a component for Agent-to-Agent (A2A) protoco…#23711
luigidemasi wants to merge 6 commits into
apache:mainfrom
luigidemasi:CAMEL-23063

Conversation

@luigidemasi

Copy link
Copy Markdown
Contributor

…l integration

Adds the camel-a2a component implementing the A2A (Agent-to-Agent) protocol for Apache Camel. The component provides both producer and consumer support, enabling Camel
routes to participate in standardized agent-to-agent communication.

Features

  • Consumer — exposes a Camel route as an A2A server with automatic agent card serving at /.well-known/agent-card.json
  • Producer — sends A2A messages (MESSAGE_SEND, MESSAGE_STREAM, TASK_GET, TASK_CANCEL, etc.) to remote agents
  • Protocol bindings — REST and JSON-RPC 2.0
  • Streaming — Server-Sent Events (SSE) for real-time task updates
  • Authentication — API key, Bearer token, OAuth 2.0, OpenID Connect
  • Task management — in-memory task store with TTL, push notifications, subscriber management
  • Agent card — discovery, resolution (file < bean < URI params), and auto-serving
  • Type converters — Message/Task to String, plus Simple DSL functions (a2aText(), a2aData(), a2aFile())
  • Progress APIA2AProgress.emit() for status updates from any route

Demo

A multi-agent demo showcasing camel-a2a in action is available at:

https://github.com/luigidemasi/camel-a2a-morning-routine

@luigidemasi luigidemasi requested a review from davsclaus June 2, 2026 15:34
Comment thread components/camel-ai/camel-a2a/src/generated/resources/a2a.json Outdated
@github-actions

github-actions Bot commented Jun 2, 2026

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.

@davsclaus davsclaus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for this substantial contribution — the A2A component is well-structured, follows Camel conventions, and has impressive test coverage. I have one blocking security finding and a few additional items.

Positive observations

  • Good security defaults: followRedirects=false, agent card loader blocks redirects, WebhookUrlValidator has SSRF protection with private IP/IPv6 checks
  • Comprehensive test coverage across operations, protocols, streaming, auth, and push notifications
  • Proper MojoHelper registration, SimpleFunctionDispatcher integration, secret = true annotations on sensitive params
  • No new external dependencies beyond Jackson (already managed by parent BOM)

General (non-inline) findings

  • Missing upgrade guide entry — per project conventions, new user-visible features should be documented in docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc
  • Dead code — the private method executeStreamProcessing in A2AConsumer (line ~1077) appears unused and should be removed
  • CI — one CI check ("build") is currently failing; the three matrix builds pass, so this may be infrastructure, but worth confirming

Note: This review evaluates the PR against Apache Camel's project rules and conventions. It does not replace specialized review tools (CodeRabbit, Sourcery) or static analysis (SonarCloud).

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

@orpiske orpiske left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM ... one minor thing about an unused method, but other than that looks fine.

Thanks @luigidemasi !

@luigidemasi luigidemasi force-pushed the CAMEL-23063 branch 2 times, most recently from 5654a96 to 22e7873 Compare June 3, 2026 13:36
luigidemasi and others added 5 commits June 3, 2026 23:45
The curly brace path parameters ({taskId}, {configId}, {id}, {param}) were being interpreted as AsciiDoc attribute references by Antora, causing 15 build warnings. Escaped with backslash prefix.
  - Fix header filter to strip all Camel* headers (security, CVE-2025-27636 vector)
  - Use Camel ExecutorServiceManager for PushNotificationDispatcher threads
  - Fix openIdConnect preference logic in auth scheme sorting
  - Move filterInboundHeaders before header reads in handleListTasks
  - Remove unused executeStreamProcessing method
  - Change component label from "ai,a2a" to "ai,agent"
  - Add upgrade guide entry for 4.21
…nd producer

  Following the CXF DataFormat convention, the dataFormat parameter now
  controls the exchange body format on both sides. PAYLOAD (default)
  extracts text, POJO delivers full Java model objects, RAW passes
  JSON strings. Renamed the old MESSAGE value to RAW and changed the
  default from POJO to PAYLOAD for backward compatibility.
…/RAW)

Adds producer-level tests verifying the full HTTP pipeline delivers the
correct body type for each mode, and consumer-level tests verifying the
processor receives the right body (String, Message, or JSON) based on
the configured dataFormat. Includes regenerated catalog and endpoint DSL
files for the dataFormat enum rename (MESSAGE → RAW, default → PAYLOAD).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@luigidemasi luigidemasi force-pushed the CAMEL-23063 branch 2 times, most recently from 4fdc0a3 to f6d1fcf Compare June 3, 2026 22:19
…access

Enables route code to read fields from the cached agent card via Simple
expressions (e.g., ${a2a:card.name}, ${a2a:card.skills}). Resolves the
card from the exchange's fromEndpoint (consumer) or by scanning context
endpoints (producer). Supports all AgentCard fields including formatted
skills text and JSON serialization.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@davsclaus davsclaus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All findings from my previous CHANGES_REQUESTED review have been addressed:

  1. Security (was blocking)filterInboundHeaders now strips all camel* headers case-insensitively, matching the project's security model for consumer header filtering.
  2. Header read orderingfilterInboundHeaders is called before reading untrusted headers (pageSize, contextId); httpPath is extracted before the filter in other handlers.
  3. ExecutorServicePushNotificationDispatcher now receives the executor via injection from getCamelContext().getExecutorServiceManager().newScheduledThreadPool(), properly shut down in doStop().
  4. Upgrade guide — entry added.
  5. Category/labels — fixed.

This review does not replace specialized AI review tools (CodeRabbit, Sourcery) or static analysis (SonarCloud).

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This PR adds the camel-a2a component implementing the Agent-to-Agent protocol — a significant new feature. The diff exceeds 20,000 lines, which is beyond what can be reviewed automatically via the GitHub API diff endpoint.

The CI checks all pass (build on JDK 17, 21, and 25), and the PR description is comprehensive — covering consumer/producer support, protocol bindings, streaming, authentication, task management, and type converters.

This PR requires manual review given its size and the scope of the new component (REST + JSON-RPC 2.0 bindings, SSE streaming, OAuth/OIDC auth, in-memory task store). I'd recommend reviewers focus on:

  • Security: authentication implementation and header filtering
  • Protocol correctness: JSON-RPC 2.0 compliance
  • Resource management: task store TTL and cleanup

Fully automatic review from Claude Code

@davsclaus

Copy link
Copy Markdown
Contributor

LGTM @luigidemasi its a massive work so when you think its ready then go ahead and merge - we need it in 4.21 so we have both MCP and A2A

@davsclaus

Copy link
Copy Markdown
Contributor

Are we getting in shape for this to be included next week

@luigidemasi

luigidemasi commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

Are we getting in shape for this to be included next week

@davsclaus yes, it is almost ready and I think we are in good shape for next week. Before marking it ready, I want to finish and incorporate the OAuth authentication support for HTTP consumers from CAMEL-23685 (#23866) and CAMEL-23723 (#23926), so A2A lands with the right auth path for 4.21.
I will update the PR later today.

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.

7 participants