Pull Request #3944
Add automatic retry for failed push notifications
Wraps PushNotificationClient.send() in a retry loop โ up to 3 attempts on failure before giving up. Applies to all failed FCM and APNs deliveries.
Ready to merge
service/NotificationService.java+24 additions
Viewed1
+ @Service
2
+ public class NotificationService {
3
+ @Autowired
4
+ private PushNotificationClient pushClient;
5
+
6
+ public void sendWithRetry(PushNotification notification) {
7
+ for (int attempt = 0; attempt < 3; attempt++) {
8
+ try {
9
+ pushClient.send(notification);
10
+ return;
11
+ } catch (PushDeliveryException e) {
12
+
13
+ }
14
+ }
15
+ log.warn("Push failed after 3 attempts: {}", notification.getId());
16
+ }
17
+ }
KL
kavya_lead
Approved review
3 retries looks right. Code is clean. Approving.