class NotifyRedisRateLimiterFilter implements NotifyFilter {

    public static final int LUA_RES_REMAIN_INDEX = 2;

    @Resource
    private RedisRateLimiter<List<Long>> redisScriptRateLimiter;

    @Override
    public int getOrder() {
        return 10;
    }

    @Override
    public void doFilter(BaseNotifyCtx context, Invoker<BaseNotifyCtx> nextFilter) {<FILL_FUNCTION_BODY>}

    private boolean check(String notifyName, int limit, long interval) {
        try {
            val res = redisScriptRateLimiter.isAllowed(notifyName, interval, limit);
            if (CollectionUtils.isEmpty(res)) {
                return true;
            }
            if (res.get(LUA_RES_REMAIN_INDEX) <= 0) {
                log.debug("DynamicTp notify, trigger redis rate limit, limitKey:{}", res.get(0));
                return false;
            }
            return true;
        } catch (Exception e) {
            log.error("DynamicTp notify, redis rate limit check failed, limitKey:{}", notifyName, e);
            return true;
        }
    }
}

        String notifyName = context.getExecutorWrapper().getThreadPoolName() + ":" + context.getNotifyItemEnum().getValue();
        boolean checkResult = check(notifyName, context.getNotifyItem().getClusterLimit(),
                context.getNotifyItem().getInterval());
        if (checkResult) {
            nextFilter.invoke(context);
        }
    
<no_super_class>