Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Spring Boot example shows how to work with the simple Camel application based on the Spring Boot.

The example generates messages using timer trigger, writes them to the standard output and the mock endpoint (for testing purposes).

This example exposes Jolokia API and Spring Boot actuators endpoints (like metrics) via the webmvc endpoint. We consider this as the best practice - Spring Boot applications with these API APIs exposed can be easily monitored and managed by the 3rd parties party tools. We also recommend to package your application as a fat WAR. Fat WARs can be executed just as regular fat jars, but you can also deploy them to the servlet containers like Tomcat. The "Fat WAR approach gives " offers you the deployment flexibility, so we highly recommend it.

...

Code Block
java -jar target/camel-example-spring-boot-2.x-SNAPSHOT.war

You will see the message printed to the console every second. To stop the example hit ctrl + c. Ctrl + C.

From Camel 2.17 the example ships with remote shell enabled which includes the Camel commands as well, so you can SSH into the running Camel application and use the camel commands to list / stop routes etc.

Code Block
ssh -p 2000 user@localhost
 
# use the password that spring-boot logs when it startup
> camel route-list camel-1
 Context        Route          Status              Total #       Failed #     Inflight #   Uptime
 -------        -----          ------              -------       --------     ----------   ------
 camel-1        route1         Started                  71              0              0   1 minute