Skip to content

Latest commit

 

History

History
80 lines (53 loc) · 2.62 KB

README.adoc

File metadata and controls

80 lines (53 loc) · 2.62 KB

Camel Example Main

This example shows how to run Camel standalone via the built-in Main class. The example also demonstrates how you can configure the Camel application via Camel built-in dependency-injection that supports binding via the @BindToRegistry, @BeanInject and @PropertyInject annotations.

Also notice how you can configure Camel in the application.properties file.

Alternative example

The class StandaloneCamel is an alternative example that provides a public static void main method and where you manually set up Camel without any help from Camel’s built-in Main class. However, it shows how to do this in a raw style without using any magic.

Build

First compile the example by executing:

$ mvn compile

How to run

Then you can run this example using

$ mvn camel:run

Camel CLI

This application is integrated with the Camel CLI via the camel-cli-connector dependency (see pom.xml). This allows to use the Camel CLI to manage this application, such as:

$mvn package camel:run

And then use the CLI to see status:

$camel get
  PID   NAME                          CAMEL            PLATFORM  READY  STATUS   AGE  TOTAL  FAILED  INFLIGHT  SINCE-LAST
 90491  org.apache.camel.example.My…  3.19.0-SNAPSHOT  Camel      1/1   Running  20s     11       0         0          0s

Camel Web Console

This example comes with embedded developer console that is accessible via http://localhost:8080/q/dev. You can also check status of health-check via http://localhost:8080/q/health. You can also access jolokia api via http://localhost:8080/q/jolokia. This gives you access to basic JMX operations. For example, to query MemoryMBean, use http://localhost:8080/q/jolokia/read/java.lang:type=Memory/HeapMemoryUsage/used.

How to configure for Camel Textual Route debugging

Several IDEs are providing support for Camel Textual Route debugging. To enable this possibility, you need to launch this example with the profile camel.debug.

$ mvn camel:run -Pcamel.debug

This profile can also be activated with camel.debug property set to true. For instance, by setting the property from command-line:

$ mvn camel:run -Dcamel.debug=true

Help and contributions

If you hit any problem using Camel or have some feedback, then please let us know.

We also love contributors, so get involved :-)

The Camel riders!