Initial draft
This commit is contained in:
1 parent
ea27160c0d
commit
d356ec8428
9 files changed
+263
No files matched your search
+29
@@ -0,0 +1,29 @@
|
||||
rabbitmqctl add_vhost app_notifications
|
||||
rabbitmqctl add_user notifier strongpassword
|
||||
rabbitmqctl set_user_tags notifier management
|
||||
rabbitmqctl set_permissions -p app_notifications notifier ".*" ".*" ".*"
|
||||
rabbitmqadmin --username "admin" --password "admin" declare exchange --vhost "app_notifications" --name "app_notifications" --type "topic" --durable "true"
|
||||
rabbitmqadmin --username "admin" --password "admin" declare queue --vhost "app_notifications" --name "notifications_retry"
|
||||
--durable "true"
|
||||
rabbitmqadmin --username "admin" --password "admin" declare queue --vhost "app_notifications" --name "notifications_dlq"
|
||||
--durable "true"
|
||||
rabbitmqadmin --username "admin" --password "admin" declare queue --vhost "app_notifications" --name "notifications"
|
||||
--durable "true"
|
||||
rabbitmqadmin --username "admin" --password "admin" declare binding --vhost "app_notifications" --source "app_notifications" --destination "notifications" --destination-type "queue" --routing-key "notify.*"
|
||||
|
||||
# Retry policy: messages stay for 30s before going back to main queue
|
||||
rabbitmqctl set_policy \
|
||||
--vhost app_notifications \
|
||||
retry_policy "^notifications_retry$" \
|
||||
'{"dead-letter-exchange":"app_notifications",
|
||||
"dead-letter-routing-key":"notify.retry",
|
||||
"message-ttl":30000}' \
|
||||
--apply-to queues
|
||||
|
||||
# DLQ policy: permanent dead letter storage
|
||||
rabbitmqctl set_policy \
|
||||
--vhost app_notifications \
|
||||
dlq_policy "^notifications$" \
|
||||
'{"dead-letter-exchange":"app_notifications",
|
||||
"dead-letter-routing-key":"notify.dlq"}' \
|
||||
--apply-to queues
|
||||
Reference in new issue
Block a user