concept WildFly Swarm in category camel

This is an excerpt from Manning's book Camel in Action.
WildFly Swarm is a Java EE application server in which you package your application and the bits from the WildFly Swarm server you need together in a fat JAR binary. You can also view WildFly Swarm as Spring Boot but for Java EE applications.
It’s easy to get started with WildFly Swarm in a new project, as you set up your Maven pom.xml by doing the following:
In the previous section, you built a Camel microservice using CDI. Now you want to take that application and run it on WildFly Swarm, so you choose Camel CDI and CDI as dependencies. You then need to make one other change, because you’re using Jetty as the HTTP server, but WildFly Swarm comes out of the box with its own HTTP server named Undertow. This requires you to change the source code, as shown in Listing 7.5.
Figure 7.1 Creating a new WildFly Swarm project from the generator web page (http://wildfly-swarm.io/generator/). Here we’ve chosen Camel CDI and CDI as the dependencies we need. Clicking the view all dependencies link shows all the dependencies you can choose from. Clicking Generate Project downloads a zip file with the generated source code.
![]()
Listing 7.5 Hello service using Undertow as HTTP server
@Singleton public class HelloRoute extends RouteBuilder { @Inject private HelloBean hello; @Inject @Uri("undertow:http://localhost:8080/hello") private Endpoint undertow; @Override public void configure() throws Exception { from(undertow) .bean(hello, "sayHello"); } } Use Undertow as HTTP server as it comes out of the box with WildFly Swarm