Repository navigation
Conversation
…olTransportObject with CloudEvent publish The client/server examples in docs/a2a-protocol called new A2AProtocolTransportObject(...), but that type is not part of the public SDK: in the code it only exists as the private inner class SimpleA2AProtocolTransportObject inside EnhancedA2AProtocolAdaptor, so the snippet cannot compile. Replace the examples with the path used by the shipped example eventmesh-examples/.../a2a/demo/mcp/McpCaller.java and by section 5.1.3 of docs/feature/a2a.md: wrap the JSON-RPC payload in a CloudEvent whose type is org.apache.eventmesh.a2a.tools.call.req (client) or org.apache.eventmesh.a2a.common.response (server) and which carries the protocol=A2A extension, then publish it. Also fixes the broken Java string concatenation in the Chinese server example and documents the response type mapping (mcptype=response, collaborationid).
|
@Lyin-OTTF what about develop branch? |
There was a problem hiding this comment.
🟡 Changes recommended
The examples omit required publishing fields and incorrectly rely on automatic A2A metadata conversion.
2 open issues
What changed in this PR
Updates the bilingual A2A usage guides to address #5226 by replacing unavailable SDK type usage with CloudEvent publishing examples.
Changes:
- Rewrites client and server publishing snippets.
- Repairs malformed Java in the Chinese examples.
- Adds internal-type and response-mapping explanations.
| File | Description |
|---|---|
| docs/a2a-protocol/README.md | Updates Chinese examples and adaptor notes. |
| docs/a2a-protocol/README_EN.md | Updates English examples and response guidance. |
Review effort: Balanced
| // 2. Wrap it as a CloudEvent. The "org.apache.eventmesh.a2a." type prefix | ||
| // together with the protocol=A2A extension triggers the A2A adaptor. |
| .withSource(URI.create("mcp-client")) | ||
| .withType("org.apache.eventmesh.a2a.tools.call.req") |
|
develop has the same problem: docs/feature/a2a.md lines 754 and 779 still call I can either retarget this PR to develop and fix docs/feature/a2a.md there instead, or keep this one for master and open a second PR against develop for a2a.md. Which do you prefer? I'll also go through the Copilot suggestions on the missing |
…hemselves Clients that publish the CloudEvent directly skip the JSON-RPC conversion in EnhancedA2AProtocolAdaptor, so mcptype, a2amethod, targetagent and, on the response side, collaborationid are never filled in. Without mcptype the peer's handleCallback cannot classify the message and drops it. The examples also omitted the data content type and the subject. The HTTP SDK's CloudEventProducer.buildCommonPostParam resolves the event format from getDataContentType() and fails when it is null, and the subject is what selects the topic.
|
Pushed a follow-up commit for both Copilot threads (82253de). Both points check out against the code:
The sentence claiming the adaptor adds |
qqeasonchen
left a comment
There was a problem hiding this comment.
LGTM,need to fix in develop branch alsl
|
The three workflows (Continuous Integration, License Check, Code Scanning) report "No jobs were run" on this PR and on #5431. None of them has path filters in Could someone with write access approve the runs? Everything else is in place here: three approvals, and the Copilot findings are addressed in 82253de. |
|
Thanks for the approvals. One heads-up: the workflows still have not run on this PR. The Actions runs are waiting on first-contributor approval, so there is no CI result to merge against yet. Could someone approve the workflow runs when convenient? The change is docs-only (two files under docs/a2a-protocol/), so I do not expect it to affect any build. |

Fixes #5226.
The client/server examples in
docs/a2a-protocol/callnew A2AProtocolTransportObject(...), but that type is not part of the public SDK: in the code it only exists as the private inner classSimpleA2AProtocolTransportObjectinsideEnhancedA2AProtocolAdaptor, so the snippet cannot compile as written.This PR replaces the examples with the path used by the shipped example
eventmesh-examples/src/main/java/org/apache/eventmesh/a2a/demo/mcp/McpCaller.javaand by section 5.1.3 ofdocs/feature/a2a.md:org.apache.eventmesh.a2a.tools.call.reqand which carries theprotocol=A2Aextension, thenproducer.publish(event);org.apache.eventmesh.a2a.common.response, and document the ingress mapping the adaptor performs (mcptype=response,collaborationid=<request id>, perEnhancedA2AProtocolAdaptor).Also fixes the broken Java string concatenation in the Chinese server example and adds a note that
A2AProtocolTransportObjectis an internal adaptor type.