rabbitmq / rabbitmq-server

Open source RabbitMQ: core server and tier 1 (built-in) plugins
https://www.rabbitmq.com/
Other
11.86k stars 3.9k forks source link

Connection is closed with 541 error, “INTERNAL_ERROR" #2574

Open wokim opened 7 years ago

wokim commented 7 years ago

Following issue is detected that application is disconnected from MQ at the very moment of two exchanges are bound.

Error step is,

  1. Create a source exchange to publish a message.
  2. Publish a message to source exchange.
  3. Create a destination exchange and bind one another.
  4. Disconnected immediately with error “Connection closed: 541(INTERNAL-ERROR)" (https://github.com/rabbitmq/rabbitmq-recent-history-exchange/blob/master/src/rabbit_exchange_type_recent_history.erl#L117)

I understand the error occurs. But one thing that I cannot understand is the result of error, disconnection. Because every time I see an error such as “404 (NOT_FOUND), channel closes not disconnection. Therefore, channel close might be more reasonable result than disconnection. Is there any other idea?

yunghoy commented 7 years ago

You can check the issue out with running code below in orderly.

[destination exchange]

const conn = await amqp.connect('amqp://localhost'); const channel = await conn.createChannel(); await channel.assertExchange(EXCHANGE_NAME2, EXCHANGE_TYPE, EXCHANGE_OPTION);

[source exchange]

let conn = await amqp.connect('amqp://localhost'); channel = await conn.createChannel();

await channel.assertExchange(EXCHANGE_NAME, EXCHANGE_TYPE, EXCHANGE_OPTION);

// Test code below setTimeout(() => { channel.on('error', (e) => { console.log("Error from amqp: ", e)}); channel.bindExchange(EXCHANGE_NAME2, EXCHANGE_NAME, '', {}); }, 15000);

[Sender]

const conn = await amqp.connect('amqp://localhost'); const channel = await conn.createChannel();

await channel.assertExchange(EXCHANGE_NAME, EXCHANGE_TYPE, EXCHANGE_OPTION); channel.publish(EXCHANGE_NAME, key, new Buffer(msg));

ralyodio commented 2 months ago

I'm getting this suddenly too, has anyone found a fix?