Error about exchange mode type in rabbitmq [How to Solve]

channel.exchange_declare(exchange='logs',
 type='fanout')

error:

Traceback (most recent call last):
File “D:/fanout_server.py”, line 12, in <module>
type=’fanout’)
TypeError: exchange_declare() got an unexpected keyword argument ‘type’

The reason is that the type parameter here must be specified as exchange_type

channel.exchange_declare(exchange='logs',
 exchange_type='fanout')

After the change, it runs normally, but strangely, some people have no problem specifying it with type. They don’t understand it

 

Similar Posts: