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

说在前面express

client管理 检查client配置apache

 

源码解析微信

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






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)结束。3d

 

说在最后code

本次解析仅表明我的观点,仅供参考。blog

 

加入技术微信群ip

钉钉技术群get

相关文章
相关标签/搜索