Skip to content

[ISSUE #5226] Fix A2A usage guide on develop: replace non-public A2AProtocolTransportObject with CloudEvent publish - #5431

Open
Lyin-OTTF wants to merge 1 commit into
apache:developfrom
Lyin-OTTF:docs/5226-a2a-develop
Open

Lyin-OTTF wants to merge 1 commit into
apache:developfrom
Lyin-OTTF:docs/5226-a2a-develop

Conversation

@Lyin-OTTF

Copy link
Copy Markdown
Contributor

Companion to #5430 (targeting master).

@qqeasonchen asked in #5430 for the develop branch to be fixed as well. On develop the A2A docs live in docs/feature/a2a.md (the docs/a2a-protocol/ directory only exists on master), and the same broken examples are there:/n/n- the client example publishes new A2AProtocolTransportObject(mcpRequest), which is the private inner class SimpleA2AProtocolTransportObject inside EnhancedA2AProtocolAdaptor and cannot compile as written;

  • the server example publishes new A2AProtocolTransportObject(mcpResponse) and additionally has a broken string concatenation around event.getId().

This PR applies the same replacement as #5430: wrap the JSON-RPC payload in a CloudEvent (type org.apache.eventmesh.a2a.tools.call.req / org.apache.eventmesh.a2a.common.response) with the required extensions (protocol, mcptype, a2amethod, targetagent, collaborationid), the subscribed topic as subject, and application/cloudevents+json as data content type — the path used by the shipped example eventmesh-examples/src/main/java/org/apache/eventmesh/a2a/demo/mcp/McpCaller.java — and fixes the concatenation.

Fixes #5226 on the develop branch.

…c A2AProtocolTransportObject with CloudEvent publish

The client and server examples in docs/feature/a2a.md call
new A2AProtocolTransportObject(...), but that type only exists as the
private inner class SimpleA2AProtocolTransportObject inside
EnhancedA2AProtocolAdaptor, so the snippets cannot compile as written.
The Chinese server example additionally has a broken string
concatenation around event.getId().

Replace both examples with the path used by the shipped example
McpCaller.java: wrap the JSON-RPC payload in a CloudEvent with type
org.apache.eventmesh.a2a.tools.call.req / .common.response, set the
required extensions (protocol, mcptype, a2amethod, targetagent,
collaborationid), subject and application/cloudevents+json data
content type, then publish. This mirrors the fix already applied to
docs/a2a-protocol/ on master in PR apache#5430.

Signed-off-by: Lyin-OTTF <htao08203@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Doc] No A2AProtocolTransportObject in EventMesh SDK

1 participant