public void removeFirst(String consumerId, StringBuilder strBuffer) {
        ConsumerEvent event = null;
        String group = consumerHolder.getGroupName(consumerId);
        boolean selDisConnMap = hasDisconnectEvent(group);
        ConcurrentHashMap<String, LinkedList<ConsumerEvent>> currentEventMap =
                selDisConnMap ? disconnectEventMap : connectEventMap;
        LinkedList<ConsumerEvent> eventList = currentEventMap.get(consumerId);
        if (eventList != null) {
            synchronized (eventList) {
                if (CollectionUtils.isNotEmpty(eventList)) {
                    event = eventList.removeFirst();
                    if (eventList.isEmpty()) {
                        currentEventMap.remove(consumerId);
                        if (selDisConnMap) {
                            MasterSrvStatsHolder.decSvrBalDisConConsumerCnt();
                        } else {
                            MasterSrvStatsHolder.decSvrBalConEventConsumerCnt();
                        }
                    }
                }
            }
        }
        if (event != null) {
            logger.info(strBuffer.append("[Event Removed] rebalanceId=")
                    .append(event.getRebalanceId()).append(",clientId=")
                    .append(consumerId).toString());
            strBuffer.delete(0, strBuffer.length());
        }
    }
Removes and returns the first consumer event from event map
disconnect event have priority over connect event

@param consumerId    the consumer id that need removed
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/master/nodemanage/nodeconsumer/ConsumerEventManager.java