Camel Example Rest Producer
This example shows how to call a REST service using Camel Rest.
The example uses a timer to trigger a Camel route to call the REST service. The REST service is embedded within Spring Boot itself so it can run standalone.
The Camel route is located in the
RestRoute class. In this class the route
starts from a timer, that triggers every 2nd second and calls the REST service using the rest endpoint
which returns a message, that is logged.
The rest producer is configured using Camels Rest DSL which is done using the
restConfiguration in the route.
The actual HTTP client that is used to call the REST service is
camel-http4 which is added as dependency
pom.xml file. You can use other HTTP clients with the REST producer such as
How to run
You can run this example using
You can find more information about Apache Camel at the website: http://camel.apache.org/