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

相關文章
相關標籤/搜索