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-http
which is added as dependency
in the pom.xml
file. You can use other HTTP clients with the REST producer such as
-
camel-http
-
camel-netty-http
-
camel-undertow
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!