Local Development with Docker Compose
Create a Docker Compose file
Create a
docker-compose.yml file with Carrier configured to forward SQS messages to your worker application.docker-compose.yml
This example requires AWS credentials to be mounted even for local SQS, otherwise the AWS SDK will panic. The credentials don’t need to be valid for local testing.
Configure your worker
Ensure your worker application:
- Listens on port
9000(or adjustCARRIER_WEBHOOK_ENDPOINT) - Has a webhook endpoint at
/webhookthat accepts POST requests - Returns appropriate HTTP status codes (200 for success, 429 for backoff)
Start the stack
Kubernetes Deployment
Prepare your service account
Create a Kubernetes ServiceAccount and map it to an IAM role with SQS permissions:
sqs:ReceiveMessagesqs:DeleteMessagesqs:GetQueueUrlsqs:ChangeMessageVisibility(required for dynamic timeouts)
Create the deployment manifest
Create a deployment with Carrier as a sidecar container:
carrier-deployment.yml
This assumes the ServiceAccount
carrier-demo is mapped to an IAM role with appropriate SQS permissions via IRSA (IAM Roles for Service Accounts).Essential Configuration
Required Environment Variables
The AWS SQS service endpoint. Use regional endpoints like
https://sqs.us-west-2.amazonaws.com or the local endpoint for testing.The name of your SQS queue (not the full ARN, just the name).
Recommended Settings
Full URL where webhooks should be sent. In Kubernetes, use
http://localhost:<port>/<path> for sidecar containers.Health check endpoint for your webhook service. Highly recommended to prevent message failures during startup.
Number of messages to receive per SQS request. Increase for higher throughput.
Number of concurrent workers transmitting webhooks per receiver. Set this equal to batch size for parallel processing.
Performance Tuning
For high-throughput scenarios, configure concurrency settings:Enable Health Checks
Health checks prevent message processing failures during application startup:- Wait for the health endpoint to return 200 before processing messages
- Check health every 60 seconds
- Exit after 5 consecutive failed health checks (triggering Kubernetes restart)
Next Steps
Configuration Reference
Explore all available environment variables and settings
Dynamic Visibility Timeouts
Learn how to implement distributed backoff strategies
Health Monitoring
Configure advanced health check scenarios
Deployment Best Practices
Production deployment patterns and recommendations
