How abdulmalikalayande/beacon works
Beacon is a Spring Boot notification library: a host submits a request, which Beacon accepts with idempotency protection and defers until the host transaction commits before queueing delivery. Workers resolve recipient preferences, enforce channel and quiet-hour rules, render templates, and send through providers with retry and fallback; provider webhooks confirm final delivery. The README also describes batching, suppression, status tracking, and pluggable backends. Provider adapters and alternative queue backends are documented as in progress. Several subsystem paths below use existing source directories because their implementations were not sampled.
Main entry points: listener After-commit listener · core Queue workers · NotificationService.java Notification API · NotificationServiceImplementation.java Accept and deduplicate
Components 24
Request ingestion
- Notification request
beacon-api/src/main/java/io/github/abdulmalikalayande/beacon/api/request/NotificationRequest.java - Notification API
beacon-api/src/main/java/io/github/abdulmalikalayande/beacon/api/service/NotificationService.java - Accept and deduplicate
beacon-core/src/main/java/io/github/abdulmalikalayande/beacon/core/service/NotificationServiceImplementation.java - Accepted event
beacon-core/src/main/java/io/github/abdulmalikalayande/beacon/core/event/NotificationRequestedEvent.java - Batch audience
beacon-api/src/main/java/io/github/abdulmalikalayande/beacon/api/spi/UserBatchSource.java
Delivery pipeline
- After-commit listener
beacon-core/src/main/java/io/github/abdulmalikalayande/beacon/core/listener - Type and channel rules
beacon-core/src/main/java/io/github/abdulmalikalayande/beacon/core/defaults/DefaultNotificationTypeRegistry.java - Queue workers
beacon-core/src/main/java/io/github/abdulmalikalayande/beacon/core - Quiet hours
beacon-core/src/main/java/io/github/abdulmalikalayande/beacon/core - Context encryption
beacon-core/src/main/java/io/github/abdulmalikalayande/beacon/core - Template resolution
beacon-api/src/main/java/io/github/abdulmalikalayande/beacon/api/spi/TemplateResolver.java - Template rendering
beacon-core/src/main/java/io/github/abdulmalikalayande/beacon/core/template/DefaultTemplateEngine.java - Suppression list
beacon-api/src/main/java/io/github/abdulmalikalayande/beacon/api/port/SuppressionList.java - Provider dispatch
beacon-api/src/main/java/io/github/abdulmalikalayande/beacon/api/port/NotificationProvider.java - Retries and fallback
beacon-api/src/main/java/io/github/abdulmalikalayande/beacon/api/port/ProviderCircuitBreaker.java - Webhook handling
beacon-api/src/main/java/io/github/abdulmalikalayande/beacon/api/port/WebhookHandler.java
State and tracking
- Delivery tasks
beacon-core/src/main/java/io/github/abdulmalikalayande/beacon/core/entity/DeliveryTaskEntity.java - Notification database
beacon-core/src/main/java/io/github/abdulmalikalayande/beacon/core/repository/DeliveryTaskRepository.java - Delivery status
beacon-core/src/main/java/io/github/abdulmalikalayande/beacon/core/entity/NotificationStatusEntity.java - Deduplication store
beacon-core/src/main/java/io/github/abdulmalikalayande/beacon/core/dedup/DefaultDeduplicationStore.java
Host and providers
- Recipient preferences
beacon-api/src/main/java/io/github/abdulmalikalayande/beacon/api/spi/UserPreferenceResolver.java - Delivery providers
- Host preference resolver
Other components
- Host application
Connections 28
- Host application → Notification API: submits
beacon-api/src/main/java/io/github/abdulmalikalayande/beacon/api/service/NotificationService.java - Host application → Notification request: provides
beacon-api/src/main/java/io/github/abdulmalikalayande/beacon/api/request/NotificationRequest.java - Notification API → Accept and deduplicate: implemented by
beacon-api/src/main/java/io/github/abdulmalikalayande/beacon/api/service/NotificationService.java - Accept and deduplicate → Deduplication store: marks key
beacon-core/src/main/java/io/github/abdulmalikalayande/beacon/core/service/NotificationServiceImplementation.java - Accept and deduplicate → Accepted event: publishes
beacon-core/src/main/java/io/github/abdulmalikalayande/beacon/core/service/NotificationServiceImplementation.java - Accepted event → After-commit listener: handled after commit
README.md - After-commit listener → Host preference resolver: resolves recipient
README.md - Host preference resolver → Recipient preferences: returns preferences
beacon-api/src/main/java/io/github/abdulmalikalayande/beacon/api/spi/UserPreferenceResolver.java - After-commit listener → Type and channel rules: applies rules
- After-commit listener → Quiet hours: checks hours
README.md - After-commit listener → Context encryption: encrypts context
README.md - After-commit listener → Delivery tasks: creates tasks
README.md - Delivery tasks → Notification database: persists in
beacon-core/src/main/java/io/github/abdulmalikalayande/beacon/core/entity/DeliveryTaskEntity.java - Notification database → Queue workers: polls tasks
README.md - Queue workers → Recipient preferences: resolves recipient
README.md - Queue workers → Template resolution: resolves template
- Template resolution → Template rendering: supplies template
- Queue workers → Template rendering: renders payload
- Queue workers → Suppression list: checks contact
README.md - Queue workers → Provider dispatch: selects provider
README.md - Provider dispatch → Delivery providers: sends notification
README.md - Queue workers → Retries and fallback: retries failures
README.md - Retries and fallback → Provider dispatch: falls back
README.md - Delivery providers → Webhook handling: posts callback
README.md - Webhook handling → Delivery status: updates status
README.md - After-commit listener → Delivery status: records initial status
README.md - Notification API → Batch audience: supports audience batches
beacon-api/src/main/java/io/github/abdulmalikalayande/beacon/api/service/NotificationService.java - Host application → Delivery status: queries status