Class BasePushNotificationSender

java.lang.Object
io.a2a.server.tasks.BasePushNotificationSender
All Implemented Interfaces:
PushNotificationSender

@ApplicationScoped public class BasePushNotificationSender extends Object implements PushNotificationSender
  • Field Details

  • Constructor Details

    • BasePushNotificationSender

      protected BasePushNotificationSender()
      No-args constructor for CDI proxy creation. CDI requires a non-private constructor to create proxies for @ApplicationScoped beans. All fields are initialized by the @Inject constructor during actual bean creation.
    • BasePushNotificationSender

      @Inject public BasePushNotificationSender(PushNotificationConfigStore configStore)
    • BasePushNotificationSender

      public BasePushNotificationSender(PushNotificationConfigStore configStore, A2AHttpClient httpClient)
  • Method Details

    • sendNotification

      public void sendNotification(StreamingEventKind event)
      Description copied from interface: PushNotificationSender
      Sends a push notification containing a streaming event.

      Called after the event has been persisted to TaskStore. The event is wrapped in a StreamResponse format (per A2A spec section 4.3.3) with the appropriate oneof field set (task, message, statusUpdate, or artifactUpdate).

      Retrieve push notification URLs or messaging configurations from PushNotificationConfigStore using the task ID extracted from the event.

      Supported event types:

      Error Handling: Log errors but don't throw exceptions. Notifications are best-effort and should not fail the primary request.

      Specified by:
      sendNotification in interface PushNotificationSender
      Parameters:
      event - the streaming event to send (Task, Message, TaskStatusUpdateEvent, or TaskArtifactUpdateEvent)
    • extractTaskId

      @Nullable protected String extractTaskId(StreamingEventKind event)
      Extracts the task ID from a StreamingEventKind event.
      Parameters:
      event - the streaming event
      Returns:
      the task ID, or null if not available