Skip to content

tutorial v3 scheduled rest call

Raymond Meester edited this page Mar 17, 2023 · 2 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.

Step 1: Clone flow

  • Like in tutorial1 clone the 'TestFlow'.

CloneFlow

Step 2: Configure the flow

  • Give the flow the name 'REST'.
  • Change the URI scheme of the From endpoint to Scheduler and the Path context to "foo".
  • Set the URI option "Delay" to "60000".

This means the connector will run every 60 seconds. Triggering the To endpoint.

SetSchedulerEndpoint

  • Set the URI scheme of the To endpoint to REST and the Path context to get:api/v1/employees.
  • Set the URI option "Host" to http://dummy.restapiexample.com.

SetRestEndpoint

As a last step we add a Response endpoint:

  • Click in the To endpoint "Add Reponse Endpoint".
  • Set the component of the Response endpoint to file and the path to "C:/messages/reply".

SetFileEndpoint

After the changes you can save the flow.

Step 3: Test the flow

  • Start the flow 'REST'

  • Check the folder "C:/messages/reply" (after 60 seconds a file with content should appear on disk)

    Tip: Check the log file to see what's happing on the background. Administration --> Log viewer. 
    

More on logs files.

Explanation on REST

The REST Component 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 simple route.

Clone this wiki locally