Overview
Carrier is configured entirely through environment variables. All configuration options are prefixed withCARRIER_ and can be set in your deployment manifest, Docker Compose file, or shell environment.
Configuration Categories
SQS Configuration
Queue connection and polling settings
Webhook Configuration
HTTP endpoint and request settings
Health Check Configuration
Worker availability monitoring
Logging Configuration
Log output and statistics
SQS Configuration
Configure how Carrier connects to and polls messages from AWS SQS.CARRIER_SQS_ENDPOINT
The endpoint for the SQS service.
CARRIER_SQS_QUEUE_NAME
The name of the SQS queue to consume messages from.
CARRIER_SQS_BATCH_SIZE
The number of messages each SQS receiver will request from SQS in a single poll.
1 to 10 (AWS SQS maximum)
Example:
All webhooks are transmitted one message per HTTP request, even when batch size is greater than 1.
CARRIER_SQS_RECEIVERS
The number of concurrent SQS receivers requesting messages from SQS.
Each receiver runs in its own goroutine and polls SQS independently. Increase this value to poll more aggressively.
CARRIER_SQS_RECEIVER_WORKERS
The number of concurrent workers transmitting messages as webhooks for each receiver.
Webhook Configuration
Configure how Carrier sends HTTP POST requests to your application.CARRIER_WEBHOOK_ENDPOINT
The full URL, including protocol and path, where webhooks will be sent.
CARRIER_WEBHOOK_REQUEST_TIMEOUT
The timeout for webhook HTTP requests.
30s, 1m, 500ms).
Example:
CARRIER_WEBHOOK_DEFAULT_CONTENT_TYPE
The default value sent in the
Content-Type header for all webhook POST requests.This can be overridden per-message by sending an SQS message attribute named
Body.ContentType. See the Dynamic Content-Type documentation for details.CARRIER_WEBHOOK_TLS_INSECURE_SKIP_VERIFY
When set to
true, the webhook transmitter will not validate TLS certificates for HTTPS endpoints.Health Check Configuration
Carrier can monitor your worker’s availability and wait for it to be ready before processing messages.CARRIER_WEBHOOK_HEALTH_CHECK_ENDPOINT
When set, enables health check functionality using the provided endpoint.
When configured, Carrier will:
- Wait for this endpoint to respond successfully before processing messages
- Exit if the endpoint becomes unavailable (useful for Kubernetes restarts)
CARRIER_WEBHOOK_HEALTH_CHECK_INTERVAL
The time interval between webhook health checks.
CARRIER_WEBHOOK_HEALTH_CHECK_TIMEOUT
The timeout for health check requests.
CARRIER_WEBHOOK_OFFLINE_THRESHOLD_COUNT
The number of consecutive failed health checks before the webhook is determined to be offline.
Logging Configuration
Control Carrier’s log output and statistics reporting.CARRIER_ENABLE_COLORIZED_LOGGING
When set to
true, enables colorized log messages for terminal output.CARRIER_ENABLE_STAT_LOG
When set to
true, enables periodic statistics log messages.- Number of active goroutines
- Memory usage
CARRIER_STAT_LOG_TIMER
The interval between statistics log messages.
Configuration Examples
Development Setup
- Docker Compose
- Shell Export
Production Kubernetes
- ConfigMap
- Deployment Env
High Throughput
Optimized for processing many messages quickly:- Runs 4 concurrent receivers
- Each receiver fetches 10 messages per poll
- Each receiver has 10 workers (40 total concurrent webhook requests)
- Processes up to 40 messages in parallel
Low Latency
Optimized for processing messages as quickly as possible:- Processes messages one at a time
- Minimizes overhead for low-volume queues
- Reduces memory footprint
With Health Checks
Ensures worker availability before processing:Environment Variable Source
The configuration structure is defined inmain.go:23-40:
Quick Reference Table
| Variable | Required | Default | Description |
|---|---|---|---|
CARRIER_SQS_ENDPOINT | Yes | - | SQS service endpoint URL |
CARRIER_SQS_QUEUE_NAME | Yes | - | Name of the SQS queue |
CARRIER_SQS_BATCH_SIZE | No | 1 | Messages per SQS poll (1-10) |
CARRIER_SQS_RECEIVERS | No | 1 | Concurrent SQS receivers |
CARRIER_SQS_RECEIVER_WORKERS | No | 1 | Workers per receiver |
CARRIER_WEBHOOK_ENDPOINT | No | http://localhost:9000 | Webhook destination URL |
CARRIER_WEBHOOK_REQUEST_TIMEOUT | No | 60s | Webhook request timeout |
CARRIER_WEBHOOK_DEFAULT_CONTENT_TYPE | No | application/json | Default Content-Type header |
CARRIER_WEBHOOK_TLS_INSECURE_SKIP_VERIFY | No | false | Skip TLS verification |
CARRIER_WEBHOOK_HEALTH_CHECK_ENDPOINT | No | - | Health check endpoint |
CARRIER_WEBHOOK_HEALTH_CHECK_INTERVAL | No | 60s | Health check interval |
CARRIER_WEBHOOK_HEALTH_CHECK_TIMEOUT | No | 10s | Health check timeout |
CARRIER_WEBHOOK_OFFLINE_THRESHOLD_COUNT | No | 5 | Failed checks before offline |
CARRIER_ENABLE_COLORIZED_LOGGING | No | false | Enable colored logs |
CARRIER_ENABLE_STAT_LOG | No | false | Enable statistics logging |
CARRIER_STAT_LOG_TIMER | No | 120s | Statistics log interval |
Next Steps
Docker Compose
Local deployment guide
Kubernetes
Production deployment guide
