aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/application
diff options
context:
space:
mode:
authorAlexis de Talhouët <adetalhouet89@gmail.com>2019-03-25 16:23:08 -0400
committerAlexis de Talhouët <adetalhouet89@gmail.com>2019-03-26 17:38:58 +0000
commit5f7f21b2bbf8a6506ac2c0afa94e15f22c83d201 (patch)
treebf43429d2e2fe63ccc37c3b45761d76443c639f9 /ms/blueprintsprocessor/application
parent4aee3138b446163fe45d4a92758e16068132ac41 (diff)
Do not start 2 netty server
As webflux is enable through maven dependency, just configure the netty server provided rather than created a new one. Change-Id: I9aff7848b08b219f9f453a522fbc5608e6e5714c Issue-ID: CCSDK-1182 Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
Diffstat (limited to 'ms/blueprintsprocessor/application')
-rw-r--r--ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintHttpServer.java33
1 files changed, 6 insertions, 27 deletions
diff --git a/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintHttpServer.java b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintHttpServer.java
index ae75488c1..85ccd1f43 100644
--- a/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintHttpServer.java
+++ b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintHttpServer.java
@@ -16,40 +16,19 @@
package org.onap.ccsdk.cds.blueprintsprocessor;
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.embedded.netty.NettyReactiveWebServerFactory;
-import org.springframework.boot.web.reactive.server.ReactiveWebServerFactory;
-import org.springframework.boot.web.server.WebServer;
-import org.springframework.http.server.reactive.HttpHandler;
+import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.stereotype.Component;
@Component
-public class BlueprintHttpServer {
-
- private static Logger log = LoggerFactory.getLogger(BlueprintHttpServer.class);
+public class BlueprintHttpServer implements WebServerFactoryCustomizer<NettyReactiveWebServerFactory> {
@Value("${blueprintsprocessor.httpPort}")
private Integer httpPort;
- @Autowired
- HttpHandler httpHandler;
-
- WebServer http;
-
- @PostConstruct
- public void start() {
- ReactiveWebServerFactory factory = new NettyReactiveWebServerFactory(httpPort);
- this.http = factory.getWebServer(this.httpHandler);
- this.http.start();
- }
-
- @PreDestroy
- public void stop() {
- this.http.stop();
+ @Override
+ public void customize(NettyReactiveWebServerFactory serverFactory) {
+ serverFactory.setPort(httpPort);
}
-}
+} \ No newline at end of file