rust-amqp
rust-amqp copied to clipboard
Channel.exchange_declare: Unexpected method frame
Steps to reproduce:
Notice auto_delete
changes.
channel.exchange_declare(exchange,
"fanout",
false, // pssive
false, // durable
false, // auto_delete
false, // internal
false, // nowait
Table::new())
.unwrap();
channel.exchange_declare(exchange,
"fanout",
false, // pssive
false, // durable
true, // auto_delete
false, // internal
false, // nowait
Table::new())
.unwrap();
Panics with: AMQP Error: Unexpected method frame: channel.close, expected: exchange.declare-ok.
I'd expect exchange_declare
to tell me that exchange is already declared without auto_delete feature.
The current implementation is not handling channel errors well. The only expected response from these kind of calls is a corresponding OK
method, like exchange.declare-ok
, I guess it should also expect channel.close
, and return it as an error.
Although, for this particular error it is strange that the server returns an error, because in the protocol specification it says that the server MUST ignore the auto-delete field if the exchange already exists.