Linux

rabbitMQ 队列

#!/bin/bash
# 获取前3个消息最多的队列进行判断
queueList=$(rabbitmqctl list_queues |grep -v 'Listing queues'|sort -r -k 2|head -3);
for queueItem in $(rabbitmqctl list_queues |grep -v 'Listing queues'|sort -r -k 2|head -3|awk '{print $1"="$2}');
do
    msgCount=$( echo $queueItem|cut -f 2 -d "=");
    if [[ $msgCount -ge 2 ]]; then
        echo '队列积压'$queueItem
    fi
done

回复

This is just a placeholder img.