[rabbitmq-discuss] Help setting you RabbitMQ and testing with the C client

438 views
Skip to first unread message

bruce bushby

unread,
Apr 12, 2011, 5:32:08 AM4/12/11
to rabbitmq...@lists.rabbitmq.com
Hello

I'm looking for some help setting up rabbitmq-server.

Rabbit server installed:
rabbitmq-server-2.2.0-1.fc14.noarch

C-Client installed:
/usr/local/bin/amqp-delete-queue
/usr/local/bin/amqp-get
/usr/local/bin/amqp-declare-queue
/usr/local/bin/amqp-publish
/usr/local/bin/amqp-consume


I then went on to configure the server...

Create vhost:
[root@plxweb01 rabbitmq]#
[root@plxweb01 rabbitmq]# rabbitmqctl add_vhost testvhost
Creating vhost "testvhost" ...
...done.
[root@plxweb01 rabbitmq]# 


Create user:
[root@plxweb01 rabbitmq]#
rabbitmqctl add_user testuser testuser123
Creating user "testuser" ...
...done.
[root@plxweb01 rabbitmq]#
[root@plxweb01 rabbitmq]#


Set user permissions:
[root@plxweb01 rabbitmq]#
[root@plxweb01 rabbitmq]# rabbitmqctl set_permissions -p testvhost testuser ".*" ".*" ".*"
Setting permissions for user "testuser" in vhost "testvhost" ...
...done.
[root@plxweb01 rabbitmq]#


Declare a queue:
[root@plxweb01 rabbitmq]#
[root@plxweb01 rabbitmq]# /usr/local/bin/amqp-declare-queue --server="plxweb01" --vhost="testvhost" --username="testuser" --password="testuser123" --queue="testqueue"
testqueue
[root@plxweb01 rabbitmq]#



I don't understand the concept of an exchange, I thought there were three types (direct,fanout & topic) ......but how do I specify the exchange? Do I need to create/associate an exchange? 

[root@plxweb01 rabbitmq]#
[root@plxweb01 rabbitmq]# /usr/local/bin/amqp-publish --server="plxweb01" --vhost="testvhost" --username="testuser" --password="testuser123" --exchange="direct" --body="test message"
closing channel: server channel error 404, message: NOT_FOUND - no exchange 'direct' in vhost 'testvhost'
[root@plxweb01 rabbitmq]#


It looks like I can publish something by specifying an empty string for exchange:

[root@plxweb01 rabbitmq]# /usr/local/bin/amqp-publish --server="plxweb01" --vhost="testvhost" --username="testuser" --password="testuser123" --exchange="" --body="test message"
[root@plxweb01 rabbitmq]#
[root@plxweb01 rabbitmq]#


But I can't read from the "default exchange":
[root@plxweb01 rabbitmq]#
[root@plxweb01 rabbitmq]# /usr/local/bin/amqp-consume  --server="plxweb01" --vhost="testvhost" --username="testuser" --password="testuser123" --exchange="" cat
Server provided queue name: amq.gen-+griWnCcj8DyRPBHX5eiDQ==
queue.bind: server channel error 403, message: ACCESS_REFUSED - operation not permitted on the default exchange
[root@plxweb01 rabbitmq]#


Any help would be much appreciated!!!

Thanks
Bruce



Valentin Bernard

unread,
Apr 12, 2011, 9:07:27 AM4/12/11
to rabbitmq...@lists.rabbitmq.com
Hi,

This tutorial, especially the part about exchanges, should answer most
of your questions: http://www.rabbitmq.com/tutorials/tutorial-three-java.html

The default (or nameless) exchange is special. The broker
automatically declares a binding for every queue on the server with
the binding key identical to the queue name. You don't have to (and,
apparently, you can't) do it yourself.

Regards,

Valentin.

> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-disc...@lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq...@lists.rabbitmq.com
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

Reply all
Reply to author
Forward
0 new messages