【问题标题】:Get the latest message in the queue获取队列中的最新消息
【发布时间】:2020-07-27 22:21:48
【问题描述】:

我想获取添加到队列中的最后/最新消息,rabbitmqadmin 实用程序中是否有特定选项可用。

以下命令给出队列中的第一条消息,

./rabbitmqadmin get queue='log' -H localhost -P 15672 -u <username> -p <password> --vhost=logging count=1

【问题讨论】:

    标签: rabbitmq queue


    【解决方案1】:

    您要消费或查看消息吗?我使用这个工具plumber 来查看最新传入的消息,而不会将它们从队列中删除。如果您只想使用最新消息,则可能需要编写脚本。

    阅读最新的入站消息并退出:

    plumber read messages rabbitmq --address amqp://user@pass:127.0.0.1:5672 --exchange events --routing-key \#
    

    查看所有消息:

    plumber read messages RabbitMQ --address amqp://user@pass:127.0.0.1:5672 --exchange events --routing-key \# --follow
    

    如果你使用管道工你的队列必须在它自己的交换器上设置你不能使用 RabbitMQ 默认交换器see

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-05-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多