Enhancement - Default Port on URI
Feature request to default the right port on URIs specified in the route spec, otherwise throw an exception to avoid partial configuration issues.
Using Cloud BUILD-SNAPSHOT as of 2/17/2018
ext {
springCloudVersion = 'Finchley.BUILD-SNAPSHOT'
}
When specifying the routes off of the RouteLocatorBuilder, you have to remember to specify the port.
@Bean
public RouteLocator customRouteLocator(RouteLocatorBuilder rlb) {
return rlb
.routes()
.route(spec -> spec
.path("/google")
.uri("https://www.google.com") // no port
)
.build();
}
Results in
2018-02-18 10:48:04.877 ERROR 6956 --- [ctor-http-nio-4] .a.w.r.e.DefaultErrorWebExceptionHandler : Failed to handle request [GET http://localhost:8080/google]
io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection timed out: no further information: www.google.com/216.58.192.228:8080
Changing the route to be
https://www.google.com:443
Gets it to work fine