private Mono<ByteBuf> handleHeartbeatRequest(UserSessionWrapper sessionWrapper) {
        UserSession session = sessionWrapper.getUserSession();
        ByteBuf data;
        if (session != null && session.isOpen()) {
            sessionService.handleHeartbeatUpdateRequest(session);
            data = HEARTBEAT_RESPONSE_SUCCESS;
        } else {
            data = ClientMessageEncoder.encodeResponse(System.currentTimeMillis(),
                    HEARTBEAT_FAILURE_REQUEST_ID,
                    ResponseStatusCode.UPDATE_HEARTBEAT_OF_NONEXISTENT_SESSION);
        }
        if (apiLoggingContext.shouldLogHeartbeatRequest()) {
            UserSession userSession = sessionWrapper.getUserSession();
            Integer version = null;
            Long userId = null;
            Integer sessionId = null;
            DeviceType deviceType = null;
            if (userSession != null) {
                version = userSession.getVersion();
                userId = userSession.getUserId();
                sessionId = userSession.getId();
                deviceType = userSession.getDeviceType();
            }
            ClientApiLogging.log(sessionId,
                    userId,
                    deviceType,
                    version,
                    sessionWrapper.getIpStr(),
                    0,
                    "HEARTBEAT",
                    0,
                    System.currentTimeMillis(),
                    data == HEARTBEAT_RESPONSE_SUCCESS
                            ? 1
                            : 0,
                    null,
                    0,
                    0);
        }
        return Mono.just(data);
    }
The method ensures serviceRequestBuffer will be released by 1
turms-gateway/src/main/java/im/turms/gateway/access/client/common/ClientRequestDispatcher.java