Giter VIP home page Giter VIP logo

spring5-webflux-rest's Introduction

CircleCI Github All Releases

Spring Framework 5 - RESTFul Interfaces with WebFlux

The source code in this repository is to support my course Spring Framework 5: Beginner to Guru.

WebFlux is a web framework new to Spring Framework 5. Learn more about Spring WebFlux and reactive programming in my course!

You can learn more about the Spring Framework at my website Spring Framework Guru

spring5-webflux-rest's People

Contributors

springframeworkguru avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring5-webflux-rest's Issues

Expose particular REST controller on specific port using Spring Webflux

Working on a spring boot based application and using spring webflux, we are exposing 3 ports

  1. server.port

  2. management.server.port (actuator) and are planning to expose another port called as admin port.

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.

`@Configuration
public class NettyServerForAdminPort {

@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.

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.