Hi You should use camel-servlet-starter to tie to the undertow from spring boot itself.
On Thu, Jan 28, 2021 at 11:53 AM Jesper Duelund Isaksen <jesper.duelund.isak...@systematic.com.invalid> wrote: > > Hello, > > In my team we are currently attempting to develop a Spring Boot 2.4.2 gateway > application which uses Apache Camel 3.7.1 to expose generic http routes using > the Undertow component and routes using the REST DSL. > > I assume that we are not correctly configuring the application since given > the pom.xml below and having manually configured the RestComponent to use > undertow as consumer, it seems two embedded Undertow instances are started. > The logs below show this. > When the test run they fail since they expect the endpoints to be found on > port 9080. > > Does anyone know what we are doing wrong or misconfiguring in this case? > > 2021-01-28 11:33:10.741 INFO 13246 --- [ main] io.undertow > : starting server: Undertow - 2.2.3.Final > 2021-01-28 11:33:10.854 INFO 13246 --- [ main] > o.s.b.w.e.undertow.UndertowWebServer : Undertow started on port(s) 9080 > (http) > ... > 2021-01-28 11:33:11.194 INFO 13246 --- [ main] > o.a.c.c.undertow.DefaultUndertowHost : Starting Undertow server on > http://0.0.0.0:0 > 2021-01-28 11:33:11.194 INFO 13246 --- [ main] io.undertow > : starting server: Undertow - 2.2.3.Final > 2021-01-28 11:33:11.198 INFO 13246 --- [ main] > o.a.c.i.e.InternalRouteStartupManager : Route: rest-endpoint1 started and > consuming from: http://0.0.0.0:0/test/endpoint1 > 2021-01-28 11:33:11.198 INFO 13246 --- [ main] > o.a.c.i.e.InternalRouteStartupManager : Route: rest-endpoint2 started and > consuming from: http://0.0.0.0:0/test/endpoint2 > ... > Tests running ... > ... > 2021-01-28 11:33:11.691 INFO 13246 --- [ - ShutdownTask] > o.a.c.c.undertow.DefaultUndertowHost : Stopping Undertow server on > http://0.0.0.0:0 > 2021-01-28 11:33:11.691 INFO 13246 --- [ - ShutdownTask] io.undertow > : stopping server: Undertow - 2.2.3.Final > ... > 2021-01-28 11:33:11.705 INFO 13246 --- [extShutdownHook] io.undertow > : stopping server: Undertow - 2.2.3.Final > > > > Maven pom.xml: > > <project xmlns="http://maven.apache.org/POM/4.0.0" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/maven-v4_0_0.xsd"> > <modelVersion>4.0.0</modelVersion> > > <groupId>org.test.gateway-lib</groupId> > <artifactId>gateway-lib</artifactId> > <name>gateway-lib</name> > <version>1.0.0-SNAPSHOT</version> > <packaging>jar</packaging> > > <properties> > <java.version>11</java.version> > <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> > > <project.reporting.sourceEncoding>UTF-8</project.reporting.sourceEncoding> > <version.camel>3.7.1</version.camel> > <version.spring-boot>2.4.2</version.spring-boot> > </properties> > > <dependencyManagement> > <dependencies> > <!-- Camel BOM --> > <dependency> > <groupId>org.apache.camel.springboot</groupId> > <artifactId>camel-spring-boot-dependencies</artifactId> > <version>${version.camel}</version> > <type>pom</type> > <scope>import</scope> > </dependency> > <!-- Spring Boot BOM --> > <dependency> > <groupId>org.springframework.boot</groupId> > <artifactId>spring-boot-dependencies</artifactId> > <version>${version.spring-boot}</version> > <type>pom</type> > <scope>import</scope> > </dependency> > </dependencies> > </dependencyManagement> > > <dependencies> > <!-- Spring dependencies --> > <dependency> > <groupId>org.springframework.boot</groupId> > <artifactId>spring-boot-starter-web</artifactId> > <exclusions> > <exclusion> > <groupId>org.springframework.boot</groupId> > <artifactId>spring-boot-starter-tomcat</artifactId> > </exclusion> > </exclusions> > </dependency> > <dependency> > <groupId>org.springframework.boot</groupId> > <artifactId>spring-boot-starter-undertow</artifactId> > </dependency> > <dependency> > <groupId>org.springframework.boot</groupId> > <artifactId>spring-boot-starter-cache</artifactId> > </dependency> > <dependency> > <groupId>org.springframework.boot</groupId> > <artifactId>spring-boot-starter-actuator</artifactId> > </dependency> > > <!-- Camel dependencies --> > <dependency> > <groupId>org.apache.camel.springboot</groupId> > <artifactId>camel-spring-boot-starter</artifactId> > </dependency> > <dependency> > <groupId>org.apache.camel.springboot</groupId> > <artifactId>camel-servlet-starter</artifactId> > </dependency> > <dependency> > <groupId>org.apache.camel.springboot</groupId> > <artifactId>camel-undertow-starter</artifactId> > </dependency> > <dependency> > <groupId>org.apache.camel.springboot</groupId> > <artifactId>camel-metrics-starter</artifactId> > </dependency> > <dependency> > <groupId>org.apache.camel.springboot</groupId> > <artifactId>camel-http-starter</artifactId> > </dependency> > <dependency> > <groupId>org.apache.camel.springboot</groupId> > <artifactId>camel-hystrix-starter</artifactId> > </dependency> > > <!-- test --> > <dependency> > <groupId>org.springframework.boot</groupId> > <artifactId>spring-boot-starter-test</artifactId> > <scope>test</scope> > </dependency> > <dependency> > <groupId>org.apache.camel</groupId> > <artifactId>camel-test-spring-junit5</artifactId> > <scope>test</scope> > </dependency> > </dependencies> > > <build> > <plugins> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-compiler-plugin</artifactId> > <version>3.8.1</version> > <configuration> > <source>11</source> > <target>11</target> > </configuration> > </plugin> > </plugins> > </build> > </project> > > > Kind regards > Jesper Isaksen -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2