helidon-io / helidon

Java libraries for writing microservices
https://helidon.io
Apache License 2.0
3.52k stars 564 forks source link

WebServer.builder() default socket configuration ignored #6675

Closed ritzow closed 5 months ago

ritzow commented 1 year ago

Environment Details


Problem Description

I expect that configuring the defaultSocket builder (through the below method or by directly using WebServer.DEFAULT_SOCKET_NAME to modify the default socket, but it does not appear to. If this is correct behavior, then there does not appear to be documentation documenting that certain default socket options cannot be configured.

Side note: It would be nice to be able to disable the default socket, or simply not have it automatically created in the first place.

Steps to reproduce

WebServer.builder()
    .defaultSocket(builder -> {
        try {
            builder
                .bindAddress(InetAddress.getByName("127.0.0.1"))
                .port(8080);
        } catch(UnknownHostException e) {
            throw new RuntimeException(e);
        }               
    })
    .build()
    .start();

Logging output

[main] INFO io.helidon.logging.slf4j.Slf4jProvider - Logging initialization.
[start @default (/0.0.0.0:0)] INFO io.helidon.nima.webserver.ServerListener - [0x66da4602] http://0.0.0.0:2516 bound for socket '@default'
[features-thread] INFO io.helidon.common.features.HelidonFeatures - Helidon NIMA 4.0.0-ALPHA6 features: [Config, Encoding, Media, WebServer]
[main] INFO io.helidon.nima.webserver.LoomServer - Started all channels in 16 milliseconds. 904 milliseconds since JVM startup. Java 20+36

Maven configuration

<dependency>
    <groupId>io.helidon.nima.webserver</groupId>
    <artifactId>helidon-nima-webserver</artifactId>
    <exclusions>
        <exclusion>
            <groupId>io.helidon.logging</groupId>
            <artifactId>helidon-logging-jul</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>io.helidon.logging</groupId>
    <artifactId>helidon-logging-slf4j</artifactId>
    <scope>runtime</scope>
</dependency>
<dependencyManagement>
<dependencies>
    <dependency>
        <groupId>io.helidon</groupId>
        <artifactId>helidon-bom</artifactId>
        <version>4.0.0-ALPHA6</version>
        <type>pom</type>
        <scope>import</scope>
    </dependency>
</dependencies>
</dependencyManagement>
trentjeff commented 1 year ago

Reassigning to @tomas-langer after discussion. He is planning an overhaul in this area with config-driven.

jbescos commented 5 months ago

There is no such WebServerConfig.Builder#defaultSocket method nowadays in Helidon 4. Is this still an issue?.

romain-grecourt commented 5 months ago

There is no such WebServerConfig.Builder#defaultSocket method nowadays in Helidon 4. Is this still an issue?.

Probably not, I've put it back in triage ; we will purge it next time we process triage issues.

tomas-langer commented 5 months ago

There was a real bug at the time this was reported. The configuration should not be honored as expected. Closing this issue.