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

Valentin Bernard vbernard42 at gmail.com
Tue Apr 12 14:07:27 BST 2011


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.

On 12 avr, 11:32, bruce bushby <bruce.bus... at gmail.com> wrote:
> 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 at plxweb01 rabbitmq]#
> [root at plxweb01 rabbitmq]# rabbitmqctl add_vhost testvhost
> Creating vhost "testvhost" ...
> ...done.
> [root at plxweb01 rabbitmq]#
>
> Create user:
> [root at plxweb01 rabbitmq]#
> rabbitmqctl add_user testuser testuser123
> Creating user "testuser" ...
> ...done.
> [root at plxweb01 rabbitmq]#
> [root at plxweb01 rabbitmq]#
>
> Set user permissions:
> [root at plxweb01 rabbitmq]#
> [root at plxweb01 rabbitmq]# rabbitmqctl set_permissions -p testvhost testuser
> ".*" ".*" ".*"
> Setting permissions for user "testuser" in vhost "testvhost" ...
> ...done.
> [root at plxweb01 rabbitmq]#
>
> Declare a queue:
> [root at plxweb01 rabbitmq]#
> [root at plxweb01 rabbitmq]# /usr/local/bin/amqp-declare-queue
> --server="plxweb01" --vhost="testvhost" --username="testuser"
> --password="testuser123" --queue="testqueue"
> testqueue
> [root at 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 at plxweb01 rabbitmq]#
> [root at 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 at plxweb01 rabbitmq]#
>
> It looks like I can publish something by specifying an empty string for
> exchange:
>
> [root at plxweb01 rabbitmq]# /usr/local/bin/amqp-publish --server="plxweb01"
> --vhost="testvhost" --username="testuser" --password="testuser123"
> --exchange="" --body="test message"
> [root at plxweb01 rabbitmq]#
> [root at plxweb01 rabbitmq]#
>
> But I can't read from the "default exchange":
> [root at plxweb01 rabbitmq]#
> [root at 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 at plxweb01 rabbitmq]#
>
> Any help would be much appreciated!!!
>
> Thanks
> Bruce
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-disc... at lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss


More information about the rabbitmq-discuss mailing list