[rabbitmq-discuss] Channel Error - 404

Robbie Clutton robert.clutton at gmail.com
Mon Feb 2 08:03:23 GMT 2009


I'm just having a play with RabbitMQ and I'm getting some connection
issues when connecting with Java, however, if I connect with a Ruby
client to the same channel it's fine, and then it seems to create the
channel and the Java client plays nicely after that.  Am I missing
some 'create channel' call?

Cheers Robbie

		ConnectionParameters params = new ConnectionParameters();
		ConnectionFactory factory = new ConnectionFactory(params);
		Connection conn = factory.newConnection("localhost");
		Channel channel = conn.createChannel();
		channel.exchangeDeclare("allqueues", "direct");
		channel.queueDeclare("queue name");
		channel.queueBind("queue name", "all queues", "routingKey");
		byte[] messageBodyBytes = "Hello, world!".getBytes();
		channel.basicPublish("all queues", "routingKey", null, messageBodyBytes);


require 'mq'
require 'pp'
EM.run do
  connection = AMQP.connect(:host => 'localhost', :logging => false)
  channel = MQ.new(connection)
  queue = MQ::Queue.new(channel, 'queue name')
  exchange = MQ::Exchange.new(channel, :fanout, 'all queues')
  exchange.publish('<transcribe id=\"something\"/>')
  exchange.publish('some more stuff')

Here's the exception I get from the Java client:

 com.rabbitmq.client.ShutdownSignalException (channel error; reason:
{#method<channel.close>(reply-code=404,reply-text=NOT_FOUND - no
exchange 'all queues' in vhost '/',class-id=50,method-id=20),null,""})
	at com.rabbitmq.client.impl.ChannelN.processAsync(ChannelN.java:191)
	at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(AMQChannel.java:159)
	at com.rabbitmq.client.impl.AMQChannel.handleFrame(AMQChannel.java:110)
	at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:456)

More information about the rabbitmq-discuss mailing list