hub_notify
hub_notify is a standalone Python microservice built for a platform called CixioHub. Its only job is sending outbound notifications: email, SMS, WhatsApp messages, and push notifications to Android and iOS devices. Other parts of the application hand off notification tasks to this service, which then picks them up and dispatches them through the appropriate third-party provider.
The service has two ways to receive work. One is a standard HTTP API with three endpoints: send a single notification immediately, queue a batch of notifications as a job, and check the progress of a queued job. The other is a background worker that listens to RabbitMQ queues. When the main application publishes a message to a queue, the worker picks it up and calls the right channel handler: SMTP for email, Twilio for SMS and WhatsApp, Firebase for Android push notifications, and AWS SNS for iOS push notifications.
Failed notifications do not disappear. The queue architecture includes a retry flow: if a dispatch fails, the message moves to a retry queue and waits before being attempted again. Delays increase with each attempt (1 minute, then 5 minutes, then 30 minutes). After four failed attempts the message moves to a dead-letter queue for that channel, and the job record in PostgreSQL is updated to reflect the failure count.
Job tracking is handled through a PostgreSQL database using SQLAlchemy. Each bulk notification job gets a UUID, and the worker updates counters for sent, failed, and retrying messages as it processes items. A caller can poll the job status endpoint to see how a large batch is progressing.
The service is configured entirely through environment variables: SMTP credentials, Twilio account details, a Firebase service account key in base64, and AWS credentials for SNS. A Dockerfile is included. The README is part of the CixioHub project and is written as internal documentation rather than a public library, so some context about the broader application is assumed.