notifications:process-push
Processes pending browser push notifications and delivers them to users.
Overview
This command handles the delivery of queued browser push notifications to users. It processes notifications in batches, handles delivery failures, and manages retry logic for reliable notification delivery.
Key Features: Batch processing, failure handling, delivery tracking, rate limiting.
Usage
Options
- --limit=COUNT
Maximum number of notifications to process per run (default: 100).
- --batch=SIZE
Number of notifications to process in a single batch (default: 20).
Processing Logic
The command follows this workflow:
Fetches pending notifications from the queue
Groups notifications into manageable batches
Delivers notifications via browser push services
Tracks delivery status and handles failures
Updates notification records with delivery results
Retries failed deliveries according to retry policy
Examples
Processes up to 100 notifications in batches of 20.
Processes up to 500 notifications in larger batches.
Processes fewer notifications with smaller batches for testing.
Shows detailed delivery information for each notification.
When to Use
Recommended Usage Scenarios
Scheduled execution every few minutes for timely delivery
Manual execution to clear notification backlogs
Testing notification delivery after configuration changes
Recovery processing after system downtime
Batch Processing
Batch Size | Use Case | Performance |
|---|---|---|
10-20 | Testing, low volume | Lower throughput, safer |
20-50 | Normal operation | Balanced performance |
50-100 | High volume periods | Higher throughput |
100+ | Backlog clearing | Maximum throughput |
Delivery Status
The command tracks various delivery outcomes:
Successful Delivery
Notification delivered to user's browser
User device received and displayed notification
Delivery confirmed by push service
Failed Delivery
Invalid Subscription: User unsubscribed or changed devices
Service Unavailable: Push service temporarily down
Rate Limited: Too many notifications sent too quickly
Invalid Payload: Malformed notification data
Retry Logic
Temporary Failures: Automatic retry with exponential backoff
Permanent Failures: Mark as failed, no further retries
Rate Limiting: Respect service limits and retry later
Performance Monitoring
Monitor these metrics during processing:
Delivery Rate: Percentage of successful deliveries
Processing Speed: Notifications processed per minute
Error Rate: Failed deliveries requiring attention
Queue Depth: Pending notifications awaiting processing
Error Handling
The command handles various error conditions:
Network Failures: Retry with backoff for temporary issues
Invalid Subscriptions: Remove expired or invalid subscriptions
Service Limits: Respect rate limits and adjust batch sizes
Malformed Data: Log errors and skip problematic notifications
Push Service Integration
Supports multiple push notification services:
Web Push Protocol: Standard browser push notifications
Firebase Cloud Messaging: Google's push service
Apple Push Notification Service: For Safari browsers
Microsoft WNS: For Edge and Windows browsers
Related Commands
notifications:queue-game-updates - Create notifications for game updates