-
Notifications
You must be signed in to change notification settings - Fork 566
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
4.x: SE Multi-port config #8019
Comments
Workaround: WebServer server = builder
.config(config.get("server"))
.routing(r -> r.any("/", (req, res) -> res.send("ok")))
.putSocket("admin", s -> s.from(builder.sockets().get("admin")).routing(r -> r
.any((req, res) -> res.send("admin ok"))))
.build()
.start(); |
i'm studying the Helidon Builder. I gues the generated WebserverConfig.Builder{
...
putSocket(String name, Consumer<ListenerConfig.Builder> consumer)
} is not intended to update exsiting ListenerConfig, but to build new ones. putSocket("admin", s -> s.routing(r -> r.any((req, res) -> res.send("admin ok")))) replaces the the "admin" ListenerConfig prototype read from configuration in the underlaying WebserverConfig.BuilderBase |
this does work well WebServer server = WebServer.builder()
.routing(r -> r.any("/", (req, res) -> res.send("ok")))
.config(config.get("server"))
.routing("admin", routingBuilder -> routingBuilder.any((req, res)-> res.send("admin ok")))
.build()
.start(); > curl http://localhost:8082
> admin ok use this method istead of putSocket routing(String socket, Consumer<HttpRouting.Builder> consumer) |
This is working as designed. We should consider improving javadoc for |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment Details
Problem Description
Configuration of additional sockets behave inconsistently, depending on the order of builder methods.
When config is provided before
putSocket
random port is used - additional socket config is ignored.When config is provided after
putSocket
correct port is used/reported as used but socket routes doesn't work.Steps to reproduce
Provide config before
➜ ~ curl http://localhost:37689 admin ok%
Provide config after
But this time admin port is not accessible!
➜ ~ curl http://localhost:8082 Endpoint not found%
The text was updated successfully, but these errors were encountered: