From 3e9fa08d4990e887a1ac73b4c4176df6ae8e3774 Mon Sep 17 00:00:00 2001 From: malladi nagarjuna Date: Mon, 10 Aug 2026 04:30:26 +0530 Subject: [PATCH] feat(server): allow injecting custom A2AHttpClient for push notifications This fixes #135 --- .../sdk/server/tasks/BasePushNotificationSender.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server-common/src/main/java/org/a2aproject/sdk/server/tasks/BasePushNotificationSender.java b/server-common/src/main/java/org/a2aproject/sdk/server/tasks/BasePushNotificationSender.java index b0f6e38d8..a41df2dea 100644 --- a/server-common/src/main/java/org/a2aproject/sdk/server/tasks/BasePushNotificationSender.java +++ b/server-common/src/main/java/org/a2aproject/sdk/server/tasks/BasePushNotificationSender.java @@ -66,8 +66,13 @@ public BasePushNotificationSender(PushNotificationConfigStore configStore) { @Inject public BasePushNotificationSender(PushNotificationConfigStore configStore, - Instance formatters) { - this.httpClient = A2AHttpClientFactory.create(); + Instance formatters, + Instance httpClientInstance) { + if (!httpClientInstance.isUnsatisfied()) { + this.httpClient = httpClientInstance.get(); + } else { + this.httpClient = A2AHttpClientFactory.create(); + } this.configStore = configStore; this.formattersByVersion = new HashMap<>(); for (PushNotificationPayloadFormatter f : formatters) {