rabbitmqadmin队列名称列表message_stats.publish_details.rate报告'浮点型'对象没有属性'encode'

mwngjboj  于 2022-11-08  发布在  RabbitMQ
关注(0)|答案(1)|浏览(141)

当我在rabbitmq 3.6.10中运行命令时,“rabbitmqadmin列出队列名称消费者message_stats.publish_details.rate”
回显属性错误:“float”对象在控制台中没有属性“encode”。

kkih6yb8

kkih6yb81#

只需修改python脚本文件“rabbitmqadmin”(422行代码):

def maybe_utf8(s):
     if isinstance(s, int):
         # s can be also an int for ex messages count
        return str(s)
     if isinstance(s, float):
        # s can be also a float for message rate
        return str(s)
     if sys.version_info[0] == 3:
        # It will have an encoding, which Python will respect
        return s

相关问题