Class SubscribeToTaskRequest

All Implemented Interfaces:
A2AMessage

public final class SubscribeToTaskRequest extends StreamingJSONRPCRequest<TaskIdParams>
JSON-RPC request to subscribe to an ongoing or completed task's event stream.

This request allows clients to reconnect to a task and receive its events, enabling recovery from disconnections or retrieval of missed updates. The agent will stream events for the task starting from its current state.

Resubscription is particularly useful for:

  • Recovering from network interruptions without losing task context
  • Multiple clients observing the same task
  • Retrieving final results for completed tasks

This class implements the JSON-RPC SubscribeToTask method as specified in the A2A Protocol.

See Also:
  • Constructor Details

    • SubscribeToTaskRequest

      public SubscribeToTaskRequest(String jsonrpc, Object id, TaskIdParams params)
      Constructs request with all parameters.
      Parameters:
      jsonrpc - the JSON-RPC version
      id - the request ID
      params - the request parameters
    • SubscribeToTaskRequest

      public SubscribeToTaskRequest(Object id, TaskIdParams params)
      Constructs request with ID and parameters.
      Parameters:
      id - the request ID
      params - the request parameters
  • Method Details