private void buildRealURI(final ServerWebExchange exchange, final ShenyuContext context, final ContextMappingRuleHandle handle) {
        Map<String, Object> attributes = exchange.getAttributes();
        String realURI = "";
        String contextPath = handle.getContextPath();
        if (StringUtils.isNoneBlank(contextPath)) {
            realURI = context.getPath().substring(contextPath.length());
            attributes.put(Constants.CONTEXT_PATH, contextPath);
        }
        final Integer percentage = Optional.ofNullable(handle.getPercentage()).orElse(100);
        final String rewriteContextPath = handle.getRewriteContextPath();
        if (StringUtils.isNoneBlank(rewriteContextPath) && ThreadLocalRandom.current().nextInt(100) < percentage) {
            // when the rewritten uri crosses plugins, this is necessary
            MetaData metaData = MetaDataCache.getInstance().obtain(rewriteContextPath + realURI);
            Optional.ofNullable(exchange.getAttribute(Constants.META_DATA))
                    .ifPresent(metadata -> attributes.put(Constants.OLD_CONTEXT_PATH_META_DATA, metadata));
            if (Objects.nonNull(metaData)) {
                attributes.put(Constants.META_DATA, metaData);
            }
            attributes.put(Constants.REWRITE_CONTEXT_PATH, rewriteContextPath);
        }
        String addPrefix = handle.getAddPrefix();
        if (StringUtils.isNoneBlank(addPrefix)) {
            if (StringUtils.isNotBlank(realURI)) {
                realURI = addPrefix + realURI;
            } else {
                realURI = addPrefix + context.getPath();
            }
        }
        context.setRealUrl(realURI);
    }
Build the realUrl.

@param context context
@param handle  handle
shenyu-plugin/shenyu-plugin-context-path/src/main/java/org/apache/shenyu/plugin/context/path/ContextPathPlugin.java