public static String buildUrl()

in core/src/main/java/org/apache/camel/kafkaconnector/utils/TaskHelper.java [49:68]


    public static String buildUrl(CamelContext camelContext, Map<String, String> props, String componentSchema, String endpointPropertiesPrefix, String pathPropertiesPrefix) throws URISyntaxException {
        Map<String, Object> filteredProps = props.entrySet().stream()
            .filter(e -> e.getKey().startsWith(endpointPropertiesPrefix) || e.getKey().startsWith(pathPropertiesPrefix))
            .collect(Collectors.toMap(
                e -> e.getKey().replace(endpointPropertiesPrefix, "").replace(pathPropertiesPrefix, ""),
                Map.Entry::getValue
            ));

        EndpointUriFactory factory = camelContext.getCamelContextExtension().getEndpointUriFactory(componentSchema);
        if (factory == null) {
            throw new IllegalStateException("Unable to compute endpoint uri. Reason: uri factory for schema `" + componentSchema + "` not found");
        }
        if (!factory.isEnabled(componentSchema)) {
            throw new IllegalStateException("Unable to compute endpoint uri. Reason: uri factory for schema `" + componentSchema + "` not enabled");
        }



        return factory.buildUri(componentSchema, filteredProps, false);
    }