This commit is contained in:
parent
a7a060ac63
commit
cfd611103c
12
rabbitmq.md
12
rabbitmq.md
@ -1,14 +1,24 @@
|
|||||||
rabbitmqctl add_vhost app_notifications
|
rabbitmqctl add_vhost app_notifications
|
||||||
|
|
||||||
rabbitmqctl add_user backend-api-internal strongpassword
|
rabbitmqctl add_user backend-api-internal strongpassword
|
||||||
|
|
||||||
rabbitmqctl set_user_tags backend-api-internal management
|
rabbitmqctl set_user_tags backend-api-internal management
|
||||||
|
|
||||||
rabbitmqctl set_permissions -p app_notifications backend-api-internal ".*" ".*" ".*"
|
rabbitmqctl set_permissions -p app_notifications backend-api-internal ".*" ".*" ".*"
|
||||||
|
|
||||||
rabbitmqadmin declare exchange --vhost "app_notifications" --name "app_notifications" --type "topic" --durable "true"
|
rabbitmqadmin declare exchange --vhost "app_notifications" --name "app_notifications" --type "topic" --durable "true"
|
||||||
|
|
||||||
rabbitmqadmin declare queue --vhost "app_notifications" --name "notifications_retry" --durable "true"
|
rabbitmqadmin declare queue --vhost "app_notifications" --name "notifications_retry" --durable "true"
|
||||||
|
|
||||||
rabbitmqadmin declare queue --vhost "app_notifications" --name "notifications_dlq" --durable "true"
|
rabbitmqadmin declare queue --vhost "app_notifications" --name "notifications_dlq" --durable "true"
|
||||||
|
|
||||||
rabbitmqadmin declare queue --vhost "app_notifications" --name "notifications" --durable "true"
|
rabbitmqadmin declare queue --vhost "app_notifications" --name "notifications" --durable "true"
|
||||||
|
|
||||||
rabbitmqadmin declare binding --vhost "app_notifications" --source "app_notifications" --destination "notifications" --destination-type "queue" --routing-key "notify.#"
|
rabbitmqadmin 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
|
# Retry policy: messages stay for 30s before going back to main queue
|
||||||
|
|
||||||
rabbitmqctl set_policy \
|
rabbitmqctl set_policy \
|
||||||
--vhost app_notifications \
|
--vhost app_notifications \
|
||||||
retry_policy "^notifications_retry$" \
|
retry_policy "^notifications_retry$" \
|
||||||
@ -17,7 +27,9 @@ rabbitmqctl set_policy \
|
|||||||
"message-ttl":30000}' \
|
"message-ttl":30000}' \
|
||||||
--apply-to queues
|
--apply-to queues
|
||||||
|
|
||||||
|
|
||||||
# DLQ policy: permanent dead letter storage
|
# DLQ policy: permanent dead letter storage
|
||||||
|
|
||||||
rabbitmqctl set_policy \
|
rabbitmqctl set_policy \
|
||||||
--vhost app_notifications \
|
--vhost app_notifications \
|
||||||
dlq_policy "^notifications$" \
|
dlq_policy "^notifications$" \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user