rocketmq源码解client管理检查client的配置

说在前面

client管理 检查client配置

 

源码解析

进入到这个方法,org.apache.rocketmq.broker.processor.ClientManageProcessor.checkClientConfig(ChannelHandlerContext, RemotingCommand)

public RemotingCommand checkClientConfig(ChannelHandlerContext ctx, RemotingCommand request)        throws RemotingCommandException {        final RemotingCommand response = RemotingCommand.createResponseCommand(null);
        CheckClientRequestBody requestBody = CheckClientRequestBody.decode(request.getBody(),            CheckClientRequestBody.class);
        if (requestBody != null && requestBody.getSubscriptionData() != null) {            SubscriptionData subscriptionData = requestBody.getSubscriptionData();
            if (ExpressionType.isTagType(subscriptionData.getExpressionType())) {                response.setCode(ResponseCode.SUCCESS);                response.setRemark(null);                return response;            }
            if (!this.brokerController.getBrokerConfig().isEnablePropertyFilter()) {                response.setCode(ResponseCode.SYSTEM_ERROR);                response.setRemark("The broker does not support consumer to filter message by " + subscriptionData.getExpressionType());                return response;            }
            try {                FilterFactory.INSTANCE.get(subscriptionData.getExpressionType()).compile(subscriptionData.getSubString());            } catch (Exception e) {                log.warn("Client {}@{} filter message, but failed to compile expression! sub={}, error={}",                    requestBody.getClientId(), requestBody.getGroup(), requestBody.getSubscriptionData(), e.getMessage());                response.setCode(ResponseCode.SUBSCRIPTION_PARSE_FAILED);                response.setRemark(e.getMessage());                return response;            }        }
        response.setCode(ResponseCode.SUCCESS);        response.setRemark(null);        return response;    }

返回到这个方法,org.apache.rocketmq.broker.processor.ClientManageProcessor.checkClientConfig(ChannelHandlerContext, RemotingCommand)结束。

 

说在最后

本次解析仅代表个人观点,仅供参考。

 

加入技术微信群

钉钉技术群

转载于:https://my.oschina.net/u/3775437/blog/3095506

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值