Files
git.stella-ops.org/src/Router/examples/Examples.NotificationService/microservice.yaml

186 lines
3.5 KiB
YAML

# Notification Service Microservice Configuration
# This file configures the service runtime behavior for multi-transport notification delivery
service:
name: notification-service
version: 1.0.0
region: us-east-1
description: "Multi-channel notification service with templates, broadcast, and real-time streaming"
# Connection to router gateways
routers:
# Primary TCP connection for synchronous request/response
- host: localhost
port: 5100
transport: tcp
priority: 1
options:
keepAlive: true
connectTimeout: 5s
sendTimeout: 30s
receiveTimeout: 300s
# RabbitMQ for reliable async messaging and queuing
- host: localhost
port: 5672
transport: rabbitmq
priority: 2
options:
virtualHost: /
prefetchCount: 50
exchange: stellaops.notifications
exchangeType: topic
deadLetterExchange: stellaops.notifications.dlx
autoRecovery: true
recoveryInterval: 5s
# UDP for broadcast notifications (one-way)
- host: localhost
port: 5201
transport: udp
priority: 3
options:
broadcast: true
multicastGroup: 239.255.0.1
# Health and lifecycle
health:
heartbeatInterval: 10s
healthCheckPath: /health
readinessCheckPath: /ready
livenessCheckPath: /live
# Reconnection behavior
resilience:
initialBackoff: 1s
maxBackoff: 60s
maxRetries: -1 # Infinite retries
circuitBreaker:
enabled: true
failureThreshold: 5
successThreshold: 2
timeout: 30s
# Priority queue configuration
priorityQueues:
enabled: true
levels:
critical: 4
high: 3
normal: 2
low: 1
routing:
critical:
transport: rabbitmq
queue: notifications.critical
ttl: 5m
high:
transport: tcp
queue: notifications.high
ttl: 15m
normal:
transport: tcp
queue: notifications.normal
ttl: 1h
low:
transport: rabbitmq
queue: notifications.low
ttl: 24h
# Rate limiting
rateLimiting:
enabled: true
defaultLimit: 1000
windowSize: 1h
perUser:
enabled: true
limit: 100
windowSize: 1h
perChannel:
sms: 10
email: 50
push: 200
inApp: 1000
# Batch processing configuration
batch:
maxBatchSize: 1000
batchTimeout: 5s
parallelism: 10
retryPolicy:
maxAttempts: 3
backoff: exponential
initialDelay: 1s
maxDelay: 30s
# Logging
logging:
level: Information
format: json
includeScopes: true
maskedFields:
- password
- apiKey
- token
- phoneNumber
# Metrics
metrics:
enabled: true
prefix: notification_service
labels:
environment: development
histogramBuckets:
delivery_latency_ms: [10, 50, 100, 250, 500, 1000, 2500, 5000, 10000]
counters:
- notifications_sent_total
- notifications_failed_total
- notifications_delivered_total
- broadcasts_completed_total
# Template configuration
templates:
directory: templates
cacheEnabled: true
cacheTtl: 5m
supportedLocales:
- en
- es
- fr
- de
- it
- pt
- ja
- zh
- ko
- ru
defaultLocale: en
# Delivery channel configuration
channels:
inApp:
enabled: true
ttl: 30d
email:
enabled: true
provider: smtp
fromAddress: noreply@example.com
replyToAddress: support@example.com
sms:
enabled: true
provider: twilio
maxLength: 160
push:
enabled: true
providers:
- fcm
- apns
webhook:
enabled: true
timeout: 10s
retries: 3
slack:
enabled: false
teams:
enabled: false