-
-
Notifications
You must be signed in to change notification settings - Fork 9
tutorial scheduled rest call
Raymond Meester edited this page Jan 21, 2024
·
15 revisions
In this tutorial you learn how to create a request/reply flow calling a REST API through a scheduler. We start with the flow created in the Quick Start.
- Like in tutorial1 clone the 'TestFlow'.
- Give the flow the name 'REST'.
- Set the component of the SOURCE step to "scheduler".
- Set the path to "foo".
- Set the URI option "Delay" to "60000".
This means the connector will run every 60 seconds. Triggering the Source step.
- Choose Add --> Action from the Source step.
- Set the component of the ACTION step to "get".
- Set the path to "api/v1/employees".
- Set the option "Host" to "http://dummy.restapiexample.com".
After the changes you can save the flow.
- Start the flow 'REST'
- Check the folder "C:/messages/out" (after 60 seconds a file with content should appear on disk)
Tip: Check the log file to see what's happening on the background. Administration --> Log viewer.
GET, POST or PUT actions can be used to host a REST endpoint (as a server) or call a REST Endpoint (as a client). More info you can find on the REST Component page.
next tutorial to create a simple Camel route.