我有一个非常简单的场景。我创建一个队列,交换并将队列绑定到交换。
Code :
String queueName = new StringBuilder("LP.DATA.").append("TESTACCOUNT").append(".").append("subLP").toString();
channel.exchangeDeclare(ExchangeConstants.DATA_EXCG, "direct", true);
channel.queueDeclare(queueName, true, false, false, null);
channel.exchangeBind(queueName, ExchangeConstants.DATA_EXCG, queueName);
I get the following error when exchangeBind() is called.
com.rabbitmq.client.ShutdownSignalException: channel error; reason: {#method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no exchange 'LP.DATA.TESTACCOUNT.subLP' in vhost '/', class-id=40, method-id=30), null, ""}
My ExchangeConstants.DATA_EXCG is "DATA_EXCG". Using RabbitMq admin I see that the exchange and queue are all created. From the exception I don't understand why is it looking for exchange with name "LP.DATA.TESTACCOUNT.subLP", this is a queuename. It seems quite trivial, I am sure I am missing something.
I am using java rabbitmq-client version 3.04.