When stopping the reactor is it necessary to open a new channel (channel 0) and then close it?

Asked by reverri

In the examples given after closing channel 1 a new channel is opened and closed before stopping the reactor. Is there a reason for this?

yield chan.channel_close()

chan0 = yield conn.channel(0)
yield chan0.connection_close()



Question information

English Edit question
txAMQP Edit question
No assignee Edit question
Solved by:
Esteve Fernandez
Last query:
Last reply:
Revision history for this message
Best Esteve Fernandez (esteve) said :

The AMQP standard states that the channel 0 is meant to be used as the "control channel": not intended for regular use, but for sending lower level commands (channel_open, connection_close, etc.)

If, for example, you want to publish a message (basic_publish), you'll have to use a different channel. According to the AMQP standard you can have as many as you want, but some brokers (e.g. OpenAMQ) only support two channels (0 and 1) and, I think, that will be the default behavior in future versions of the AMQP standard.

Revision history for this message
reverri (reverri) said :

Thanks Esteve Fernandez, that solved my question.