rabbitmq中關於exchange模式type報錯


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

報錯:

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'

 

原因這里的type參數必須指定為exchange_type才行

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

改完之后運行正常,但奇怪的是有的人用type指定就沒問題,搞不懂

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM