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!
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。