Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nima WebClient Builder Config support follow up #7078

Closed
Tracked by #6741
arjav-desai opened this issue Jun 23, 2023 · 0 comments
Closed
Tracked by #6741

Nima WebClient Builder Config support follow up #7078

arjav-desai opened this issue Jun 23, 2023 · 0 comments
Assignees
Labels
4.x Version 4.x webclient
Milestone

Comments

@arjav-desai
Copy link
Member

In V3, following is set on builder from config, https://github.com/helidon-io/helidon/blob/helidon-3.x/webclient/webclient/src/main/java/io/helidon/webclient/WebClientConfiguration.java#L700,

            config.get("uri").asString().ifPresent(baseUri -> uri(URI.create(baseUri)));
            config.get("connect-timeout-millis").asLong().ifPresent(timeout -> connectTimeout(Duration.ofMillis(timeout)));
            config.get("read-timeout-millis").asLong().ifPresent(timeout -> readTimeout(Duration.ofMillis(timeout)));
            config.get("follow-redirects").asBoolean().ifPresent(this::followRedirects);
            config.get("max-redirects").asInt().ifPresent(this::maxRedirects);
            config.get("user-agent").asString().ifPresent(this::userAgent);
            config.get("keep-alive").asBoolean().ifPresent(this::keepAlive);
            config.get("cookies").asNode().ifPresent(this::cookies);
            config.get("headers").asNode().ifPresent(this::headers);
            DeprecatedConfig.get(config, "tls", "ssl")
                    .as(WebClientTls.builder()::config)
                    .map(WebClientTls.Builder::build)
                    .ifPresent(this::tls);
            config.get("proxy")
                    .as(Proxy.builder()::config)
                    .map(Proxy.Builder::build)
                    .ifPresent(this::proxy);
            config.get("media-support").as(MediaContext::create).ifPresent(this::mediaContext);
            config.get("relative-uris").asBoolean().ifPresent(this::relativeUris);
            config.get("dns-resolver-type").asString()
                    .map(s -> DnsResolverType.valueOf(s.toUpperCase()))
                    .ifPresent(this::dnsResolverType);

In V4, we are adding some of this with Issue #6935 and PR #7056. However, following is not yet available to set and should be added when ready.

config.get("cookies").asNode().ifPresent(this::cookies);
config.get("proxy")
		.as(Proxy.builder()::config)
		.map(Proxy.Builder::build)
		.ifPresent(this::proxy);
config.get("media-support").as(MediaContext::create).ifPresent(this::mediaContext);
config.get("relative-uris").asBoolean().ifPresent(this::relativeUris);
config.get("dns-resolver-type").asString()
		.map(s -> DnsResolverType.valueOf(s.toUpperCase()))
		.ifPresent(this::dnsResolverType);
@arjav-desai arjav-desai added webclient 4.x Version 4.x labels Jun 23, 2023
@m0mus m0mus changed the title Updated Nima WebClient Builder to set values from config when available Nima WebClient Builder Config support follow up Jun 26, 2023
@m0mus m0mus added this to the 4.0.0-M1 milestone Jun 26, 2023
@m0mus m0mus modified the milestones: 4.0.0-M1, 4.0.0-M2 Jun 29, 2023
@romain-grecourt romain-grecourt mentioned this issue Jun 29, 2023
18 tasks
@m0mus m0mus added this to Backlog Aug 12, 2024
@m0mus m0mus moved this to Closed in Backlog Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x webclient
Projects
Archived in project
Development

No branches or pull requests

3 participants