# 启动服务
# rabbitmq 需要启用检查命令
# linux
rabbitmq-plugins enable rabbitmq_delayed_message_exchange
# docker
docker exec -it <rabbitmq-container> rabbitmq-plugins enable rabbitmq_delayed_message_exchange
# k8s
kubectl exec -n rabbitmq <pod-name> -- rabbitmq-plugins enable rabbitmq_delayed_message_exchange

# ps. 我用的k8s, 装插件太麻烦, 不整了

# 验证插件生效
rabbitmq-plugins list | grep delayed

# 启动消费者（无延迟）：
python consumer_delay.py

# 发送一条 10 秒后投递的消息：
python producer_delay.py 10000 "Order pay timeout"