public Set<Argument> getArguments(HttpServletRequest request, String namespace, String service) {
		RateLimitProto.RateLimit rateLimitRule = serviceRuleManager.getServiceRateLimitRule(namespace, service);
		if (rateLimitRule == null) {
			return Collections.emptySet();
		}
		List<RateLimitProto.Rule> rules = rateLimitRule.getRulesList();
		if (CollectionUtils.isEmpty(rules)) {
			return Collections.emptySet();
		}
		return rules.stream()
				.flatMap(rule -> rule.getArgumentsList().stream())
				.map(matchArgument -> {
					String matchKey = matchArgument.getKey();
					Argument argument = null;
					switch (matchArgument.getType()) {
						case CUSTOM:
							argument = StringUtils.isBlank(matchKey) ? null :
									Argument.buildCustom(matchKey, Optional.ofNullable(getCustomResolvedLabels(request).get(matchKey)).orElse(StringUtils.EMPTY));
							break;
						case METHOD:
							argument = Argument.buildMethod(request.getMethod());
							break;
						case HEADER:
							argument = StringUtils.isBlank(matchKey) ? null :
									Argument.buildHeader(matchKey, Optional.ofNullable(request.getHeader(matchKey)).orElse(StringUtils.EMPTY));
							break;
						case QUERY:
							argument = StringUtils.isBlank(matchKey) ? null :
									Argument.buildQuery(matchKey, Optional.ofNullable(request.getParameter(matchKey)).orElse(StringUtils.EMPTY));
							break;
						case CALLER_SERVICE:
							String sourceServiceNamespace = MetadataContextHolder.getDisposableMetadata(DEFAULT_METADATA_SOURCE_SERVICE_NAMESPACE, true).orElse(StringUtils.EMPTY);
							String sourceServiceName = MetadataContextHolder.getDisposableMetadata(DEFAULT_METADATA_SOURCE_SERVICE_NAME, true).orElse(StringUtils.EMPTY);
							if (!StringUtils.isEmpty(sourceServiceNamespace) && !StringUtils.isEmpty(sourceServiceName)) {
								argument = Argument.buildCallerService(sourceServiceNamespace, sourceServiceName);
							}
							break;
						case CALLER_IP:
							argument = Argument.buildCallerIP(Optional.ofNullable(request.getRemoteAddr()).orElse(StringUtils.EMPTY));
							break;
						default:
							break;
					}
					return argument;
				}).filter(Objects::nonNull).collect(Collectors.toSet());
	}
@Test
	public void testGetRuleArguments() {
		// Mock request
		MetadataContext.LOCAL_SERVICE = "Test";
		MockHttpServletRequest request = new MockHttpServletRequest(null, "GET", "/xxx");
		request.setParameter("yyy", "yyy");
		request.addHeader("xxx", "xxx");
		MetadataContext metadataContext = new MetadataContext();
		metadataContext.setUpstreamDisposableMetadata(new HashMap<String, String>() {{
			put(DEFAULT_METADATA_SOURCE_SERVICE_NAMESPACE, MetadataContext.LOCAL_NAMESPACE);
			put(DEFAULT_METADATA_SOURCE_SERVICE_NAME, MetadataContext.LOCAL_SERVICE);
		}});
		MetadataContextHolder.set(metadataContext);
		Set<Argument> arguments = rateLimitRuleArgumentServletResolver1.getArguments(request, MetadataContext.LOCAL_NAMESPACE, MetadataContext.LOCAL_SERVICE);
		Set<Argument> exceptRes = new HashSet<>();
		exceptRes.add(Argument.buildMethod("GET"));
		exceptRes.add(Argument.buildHeader("xxx", "xxx"));
		exceptRes.add(Argument.buildQuery("yyy", "yyy"));
		exceptRes.add(Argument.buildCallerIP("127.0.0.1"));
		exceptRes.add(Argument.buildCustom("xxx", "xxx"));
		exceptRes.add(Argument.buildCallerService(MetadataContext.LOCAL_NAMESPACE, MetadataContext.LOCAL_SERVICE));
		assertThat(arguments).isEqualTo(exceptRes);

		rateLimitRuleArgumentServletResolver2.getArguments(request, MetadataContext.LOCAL_NAMESPACE, MetadataContext.LOCAL_SERVICE);
		rateLimitRuleArgumentServletResolver3.getArguments(request, MetadataContext.LOCAL_NAMESPACE, MetadataContext.LOCAL_SERVICE);
		rateLimitRuleArgumentServletResolver4.getArguments(request, MetadataContext.LOCAL_NAMESPACE, MetadataContext.LOCAL_SERVICE);
	}