[rabbitmq-discuss] No Exchange Error

Matthias Radestock matthias at lshift.net
Thu Jul 23 18:40:19 BST 2009


Patrick,

Patrick Kenney wrote:
> in working with the samples I am using the following test consumer
> snippet ...
> 
> <snip>
> ServiceHost dispatcherHost = new ServiceHost(typeof(DispatcherService),
> new Uri("soap.amqp:///"));
> dispatcherHost.AddServiceEndpoint(typeof(IDispatcherService), new
> RabbitMQBinding(new Uri("amqp://localhost:5672/"), Protocols.AMQP_0_8),
> "soap.amqp://localhost/dispatcher");
> </snip>
> 
> when the RabbitMQBinding is hit in the RabbitMQ.Service model I get the
> following nasty gram...
> 
> RabbitMQ.Client.Exceptions.OperationInterruptedException was unhandled
> by user code
>   Message="The AMQP operation was interrupted: AMQP close-reason,
> initiated by Peer, code=404, text=\"NOT_FOUND - no exchange 'localhost'
> in vhost '/'\", classId=50, methodId=20, cause="
>   Source="RabbitMQ.Client"

The error says that you attempted to access an exchange 'localhost',
which doesn't exist.

According to the RabbitMQ WCF binding documentation,
  serviceAddress = “soap.amqp://” [exchangeName] “/” serviceName
which, looking at the above code, explains where the exchange name comes
from.

I suspect you meant to use the default exchange instead, in which case,
as per the docs ("If the exchange name is omitted, the default exchange
is used.") just leave out the exchange name.


Matthias.




More information about the rabbitmq-discuss mailing list