I want to address the complete picture of webhook reliability during auto-scaling operations, covering webhook retry configuration, the actual impact of cloud auto-scaling, and proper event delivery monitoring.
Understanding Auto-Scaling Impact on Webhooks:
SAP CX cloud auto-scaling operates in two phases that affect webhook delivery differently:
-
Scale-Up Phase (5-7 minutes): New application instances are provisioned and initialized. During initialization, these instances don’t process webhook queues yet. If your webhook consumer expects consistent source IPs, new instances will appear as new sources.
-
Scale-Down Phase (3-5 minutes): Existing instances are gracefully drained before termination. Webhook queues on these instances should be transferred to remaining instances, but there’s a brief window where queue redistribution can cause delays.
The key issue: SAP CX’s default webhook configuration assumes stable infrastructure and doesn’t account for these transition periods.
Optimal Webhook Retry Configuration:
For environments with auto-scaling enabled, configure webhooks with these settings:
Basic Retry Settings:
- Retry Attempts: 6 (increased from default 3)
- Retry Strategy: Exponential Backoff (not fixed intervals)
- Initial Retry Delay: 2 minutes
- Maximum Retry Delay: 30 minutes
- Request Timeout: 45 seconds (increased from 30s)
Exponential Backoff Schedule:
- Attempt 1: Immediate (initial delivery)
- Attempt 2: +2 minutes (still within scaling window)
- Attempt 3: +5 minutes (7 minutes total - likely after scale-up completes)
- Attempt 4: +10 minutes (17 minutes total)
- Attempt 5: +20 minutes (37 minutes total)
- Attempt 6: +30 minutes (67 minutes total)
This configuration ensures at least 3-4 retry attempts occur AFTER the typical 5-7 minute auto-scaling transition window.
Configuration in SAP CX:
Navigate to: Event Management → Webhook Configurations → [Your Webhook] → Delivery Settings
Update these parameters:
- `webhook.retry.max.attempts=6
- `webhook.retry.strategy=EXPONENTIAL_BACKOFF
webhook.retry.initial.delay=120000 (2 minutes in milliseconds)
webhook.retry.max.delay=1800000 (30 minutes in milliseconds)
webhook.retry.multiplier=2.5 (exponential growth factor)
webhook.timeout=45000 (45 seconds in milliseconds)
Advanced: Queue Persistence Configuration
To prevent webhook loss during instance termination, enable persistent webhook queues:
Event Management → Advanced Settings → Queue Configuration:
- `webhook.queue.persistence=ENABLED
webhook.queue.replication=3 (replicate across 3 instances)
webhook.queue.drain.timeout=300000 (5 minutes drain time before instance shutdown)
This ensures webhook events are replicated across multiple instances. If one instance is terminated during scale-down, other instances already have copies of pending webhooks.
Event Delivery Monitoring Improvements:
The standard event delivery monitoring doesn’t provide enough visibility during auto-scaling. Implement these monitoring enhancements:
-
Custom Event Delivery Dashboard:
- Track delivery success rate by 5-minute intervals
- Overlay auto-scaling events (from SAP CX audit logs) on the timeline
- Alert when success rate drops below 95% for more than 10 minutes
-
Webhook Health Checks:
- Configure SAP CX to send test events every 2 minutes to a dedicated health check endpoint
- Monitor health check delivery latency - spikes indicate scaling transitions
- Use health check data to predict when production webhooks might fail
-
Consumer-Side Logging:
- Log ALL incoming webhook requests with timestamps and source IPs
- Compare consumer logs with SAP CX delivery logs to identify truly lost events
- Track which source IPs deliver webhooks - new IPs indicate scale-up events
Handling Scale-Down Webhook Loss:
If you still see “RETRY_EXHAUSTED” events that never reached your consumer, implement a reconciliation process:
-
Daily Reconciliation Job:
- Query SAP CX for all RETRY_EXHAUSTED events from the past 24 hours
- Compare against your consumer’s processed events log
- Re-fetch missing events via SAP CX Event API and process manually
-
Real-Time Reconciliation:
- Subscribe to “webhook.delivery.failed” events in SAP CX
- When a webhook exhausts retries, automatically trigger a fallback delivery via direct API call
- Log these fallback deliveries separately for monitoring
Verification and Testing:
After implementing these configurations:
- Simulate Auto-Scaling: Trigger artificial load to force auto-scaling (if you have test environment access)
- Monitor Retry Patterns: Check event delivery logs during scaling - you should see retries spread across the transition window
- Measure Improvement: Compare delivery success rates before/after configuration changes
- Validate Zero Loss: Run reconciliation job for a week - should find zero truly lost events
Expected Results:
With these configurations, you should achieve:
- 99.95%+ delivery success rate even during auto-scaling
- Maximum delivery delay of 60-70 minutes for events caught in scaling transitions (acceptable for most use cases)
- Zero permanently lost events (all events either delivered or available for reconciliation)
The combination of exponential backoff, increased retry attempts, queue persistence, and reconciliation processes ensures webhook reliability regardless of cloud infrastructure scaling operations.
This draft is based on general SAP Customer Experience (SAP CX) knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.