Class A2aJsonRpcServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet,jakarta.servlet.ServletConfig,Serializable
SendMessage (execute a skill synchronously, answer with a completed or
failed task) and GetTask (read a recent task back). Authentication is the surrounding
security chain's; the feature toggle is A2aServerEnabledFilter's; read-only enforcement
for mutating skills happens here, mirroring what the Agent Card advertises.
Responses are SDK spec types written by A2aServerJson, so the wire shapes are the
spec's rather than this class's opinion of them. That matters most for SendMessage,
whose result is a oneof: 1.0 wraps it as {"result":{"task":…}}, where 0.3 inlined the
task. Error codes come from the SDK's typed errors (-32001 TaskNotFound, -32004
UnsupportedOperation, plus the standard -32600/-32601/-32602/-32603 family).
0.3 callers. A2A negotiates its version with the A2A-Version header and 1.0
renamed every method (message/send → SendMessage). A client that sends the old
names is speaking 0.3, and answering it with a bare "method not found" sends an integrator
hunting for a typo in a name that is correct for the version their client chose — so those names
are recognised and answered with what to send instead. They are not served.
- See Also:
-
Field Summary
Fields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD -
Constructor Summary
ConstructorsConstructorDescriptionA2aJsonRpcServlet(A2aSkillRegistry skills, A2aTaskStore taskStore, A2aReleaseTaskMapper releaseTaskMapper, A2aPushNotificationRegistry pushRegistry, BooleanSupplier readOnly) -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoPost(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPatch, doPut, doTrace, getLastModified, init, isSensitiveHeader, service, serviceMethods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
A2aJsonRpcServlet
public A2aJsonRpcServlet(A2aSkillRegistry skills, A2aTaskStore taskStore, A2aReleaseTaskMapper releaseTaskMapper, A2aPushNotificationRegistry pushRegistry, BooleanSupplier readOnly) - Parameters:
skills- the skills this endpoint can executetaskStore- the read-back window for answered tasksreadOnly- whether the A2A feature is in read-only mode, read per request so a toggle takes effect without a restart
-
-
Method Details
-
doPost
protected void doPost(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException - Overrides:
doPostin classjakarta.servlet.http.HttpServlet- Throws:
IOException
-