OS/Linux

Rabbitmq admin cli 설정

아르비스 2015. 2. 12. 21:02

Example Commands/Setup:

The following commands should give you the majority if not all of what you need:

# Get the cli and make it available to use.
wget http://127.0.0.1:15672/cli/rabbitmqadmin
# I know, don't use 777... but it keeps the example simple...
chmod 777 rabbitmqadmin
mv rabbitmqadmin /etc/rabbitmq

Add a user and permissions

rabbitmqctl add_user testuser testpassword
rabbitmqctl set_user_tags testuser administrator
rabbitmqctl set_permissions -p / testuser ".*" ".*" ".*"

Make a virtual host and Set Permissions

rabbitmqctl add_vhost Some_Virtual_Host
rabbitmqctl set_permissions -p Some_Virtual_Host guest ".*" ".*" ".*"

Make an Exchange

./rabbitmqadmin declare exchange --vhost=Some_Virtual_Host name=some_exchange type=direct

Make a Queue

./rabbitmqadmin declare queue --vhost=Some_Virtual_Host name=some_outgoing_queue durable=true

Make a Binding

./rabbitmqadmin --vhost="Some_Virtual_Host" declare binding source="some_exchange" destination_type="queue" destination="some_incoming_queue" routing_key="some_routing_key"


Declare an exchange

$ rabbitmqadmin declare exchange name=my-new-exchange type=fanout
exchange declared

Declare a queue, with optional parameters

$ rabbitmqadmin declare queue name=my-new-queue durable=false
queue declared


[example to make exchange]

./rabbitmqadmin declare exchange name=DRM.Processing type=direct

./rabbitmqadmin declare exchange name=Event.Processing type=direct

./rabbitmqadmin declare exchange name=File.ConvertProcessing type=direct

./rabbitmqadmin declare exchange name=File.Logging type=direct

./rabbitmqadmin declare exchange name=File.Processing type=direct

./rabbitmqadmin declare exchange name=File.SearchProcessing type=direct

./rabbitmqadmin declare exchange name=Post.ErrorProcessing type=direct

./rabbitmqadmin declare exchange name=Post.RetryProcessing type=direct


[example to make queue]

./rabbitmqadmin declare queue name=DRM.DecryptQueue durable=true

./rabbitmqadmin declare queue name=Event.FeedQueue durable=true

./rabbitmqadmin declare queue name=Event.NotiQueue durable=true

./rabbitmqadmin declare queue name=File.ConvertQueue durable=true

./rabbitmqadmin declare queue name=File.LogQueue durable=true

./rabbitmqadmin declare queue name=File.SearchQueue durable=true

./rabbitmqadmin declare queue name=Post.ErrorQueue durable=true

./rabbitmqadmin declare queue name=Post.RetryQueue durable=true


[example queue bind to exchange]

./rabbitmqadmin declare binding source="DRM.Processing" destination_type="queue" destination="DRM.DecryptQueue"

./rabbitmqadmin declare binding source="Event.Processing" destination_type="queue" destination="Event.FeedQueue"

./rabbitmqadmin declare binding source="Event.Processing" destination_type="queue" destination="Event.NotiQueue"

./rabbitmqadmin declare binding source="File.ConvertProcessing" destination_type="queue" destination="File.ConvertQueue"

./rabbitmqadmin declare binding source="File.Logging" destination_type="queue" destination="File.LogQueue"

./rabbitmqadmin declare binding source="File.Processing" destination_type="queue" destination="File.ConvertQueue"

./rabbitmqadmin declare binding source="File.Processing" destination_type="queue" destination="File.SearchQueue"

./rabbitmqadmin declare binding source="File.SearchProcessing" destination_type="queue" destination="File.SearchQueue"

./rabbitmqadmin declare binding source="Post.ErrorProcessing" destination_type="queue" destination="Post.ErrorQueue"

./rabbitmqadmin declare binding source="Post.RetryProcessing" destination_type="queue" destination="Post.RetryQueue"