Repository navigation
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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(thedocs/a2a-protocol/directory only exists on master), and the same broken examples are there:/n/n- the client example publishesnew A2AProtocolTransportObject(mcpRequest), which is the private inner classSimpleA2AProtocolTransportObjectinsideEnhancedA2AProtocolAdaptorand cannot compile as written;new A2AProtocolTransportObject(mcpResponse)and additionally has a broken string concatenation aroundevent.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 assubject, andapplication/cloudevents+jsonas data content type — the path used by the shipped exampleeventmesh-examples/src/main/java/org/apache/eventmesh/a2a/demo/mcp/McpCaller.java— and fixes the concatenation.Fixes #5226 on the develop branch.