[rabbitmq-discuss] No Exchange Found In V Host Issue

Matthias Radestock matthias at rabbitmq.com
Fri Aug 31 13:02:39 BST 2012


Rajni,

On 31/08/12 12:16, Rajni wrote:
> I’m trying to publish a message using the code below:
>
> *String exchangeName = “directPublishMessageToIndexServiceExchangeName”;*
> *String routeKey = “directPublishMessageToIndexServiceRoutekeyName”;*
> **
> *channel = connection.createChannel();*
> *channel.basicPublish(exchangeName,routeKey, properties,messageBody);*
> *channel.close();*
>
> and when I try to run the code it’s giving an error like below :
>
> *ERROR - Exception in closing Channel :
> com.rabbitmq.client.ShutdownSignalException: channel error; reason:
> {#method<channel.close>(reply-code=404,reply-text=NOT_FOUND - no
> exchange 'directPublishMessageToIndexServiceExchangeName' in vhost
> '/',class-id=60,method-id=40),null,""}*

You are missing an exchangeDeclare.

Have you read the rabbit tutorials 
(http://www.rabbitmq.com/getstarted.html)? Exchange declaration is 
covered in tutorial 3.

Regards,

Matthias.


More information about the rabbitmq-discuss mailing list