#添加exchange
rabbitmqctl eval 'rabbit_exchange:declare({resource, <<"/">>, exchange, <<"exchange_pent">>}, topic, true, false, false, []).'
#添加队列
rabbitmqctl eval 'rabbit_amqqueue:declare({resource, <<"/">>, queue, <<"pre.queue">>}, true, false, [], none).'
#绑定队列
rabbitmqctl eval 'rabbit_binding:add({binding, {resource, <<"test">>, exchange, <<"ac.exchange.alarm">>}, <<"ac.routing.key.alarm">>, {resource, <<"test">>, queue, <<"ac.queue.alarm">>}, []}).'
rabbitmqctl eval 'rabbit_binding:add({binding, {resource, <<"/">>, exchange, <<"exchange_pent">>}, <<"#">>, {resource, <<"/">>, queue, <<"pre.queue">>}, []}).'
参考:https://blog.csdn.net/hncscwc/article/details/79048647