Working on a spring boot based application and using spring webflux, we are exposing 3 ports
We want to expose a specific REST controller on this admin port which will be private. This api will provide all the admin level configuration and will not be available publicly to the user.
Note: We don't want to expose api on actuator port. Need to open a new port.
Using the following code to open a new port by starting a new server instance.
@Value("${admin.port}")
private Integer adminPort;
@Autowired
HttpHandler httpHandler;
WebServer http;
@PostConstruct
public void start() {
ReactiveWebServerFactory factory = new NettyReactiveWebServerFactory(8081);
this.http = factory.getWebServer(this.httpHandler);
this.http.start();
}
@PreDestroy
public void stop() {
this.http.stop();
}
Spring boot, webflux doesn't provide an out of box solution for this, can this be achieved using RouterFunction ??
Any insights here would be helpful.