[rabbitmq-discuss] Shovel on default virtual-host!

Matthias Radestock matthias at rabbitmq.com
Mon Dec 31 15:11:18 GMT 2012


Gabriele,

On 31/12/12 14:37, Gabriele Santomaggio wrote:
> I use this file:
> https://github.com/rabbitinaction/sourcecode/blob/master/configs/rabbitmq/rabbitmq.config.shovel
> So,it doesn't wok  on my installation (two debian-6 with rabbitmq 3.0.1).
> I had to add "%2f” on [{broker, "amqp://guest:guest@localhost:5672/%2f"}
> and now it works.
>
> Without "%2f" I get this error:
> {amqp_error,access_refused,"access to vhost '' refused for user
> 'shovel'",'connection.open'}}
>
> I have read the amqp-uri spec here:
> http://pubs.vmware.com/vfabric52/index.jsp?topic=/com.vmware.vfabric.rabbitmq.2.8/rabbit-web-docs/uri-spec.html
>
> Could be an error?  Or  some configuration changed with the release
> RabbitMQ 3.0 ?

The docs you reference (as well as the docs for 3.0 at 
http://www.rabbitmq.com/uri-spec.html) state that:

<quote>
The vhost component may be absent; this is indicated by the lack of a 
"/" character following the amqp_authority. An absent vhost component is 
not equivalent to an empty (i.e. zero-length) vhost name.
</quote>

The above is correct as of RabbitMQ 2.7.0, so I'm guessing the example 
you found pre-dates that.

Note that instead of adding %2f you could also drop the /, i.e. write 
"amqp://guest:guest@localhost:5672", since when the vhost is absent it 
is replaced by the default, which is "/".

Also, you really should specify a uri of "amqp://" when connecting to 
the broker in which the shovel is running; that is establishing a direct 
connection rather than the network connection you'd get with a full URI, 
and is therefore considerably more efficient.

Regards,

Matthias.


More information about the rabbitmq-discuss mailing list