We had several questions about polling frequency configuration with Streamdata.io, so I thought it was worth writing a blog post to share different options you have. If you are completely new to Streamdata.io, I invite you to read our How it works
page as it is a good starting point to understand the general concepts. If you are not a streamer yet, you can easily register for a free account here
At the time I am writing this blog post, polling frequency is only configurable via our Web Portal
. Note that we already planned to enable polling frequency configuration via API in a near future. But for now, let's focus on the two different options you can find in Streamdata.io portal:
Option 1 : Default Polling Frequency
You can define a default polling frequency for each of your application. This configuration will only apply to newly created APIs within selected application. In case your application already contains APIs, their polling frequency will remain unchanged.
To configure the default polling frequency for an app, follow these steps :
- Login to Streamdata.io Portal
- Select an application.
- Select Settings
on the right side menu, then select Polling Frequency
- You can now set the default polling frequency that will be applied to all newly created APIs. Do not forget to Save
Option 2 : Specific Polling Frequency
In addition to the default polling frequency, you can override the polling frequency for each API. This can be done by simply editing the API. Note APIs are automatically provisioned in the portal the first time you call the target URL through our proxy.
You can do it by simply running a cURL command matching following pattern:
curl -v "https://streamdata.motwin.net/[http://targetURL]?X-Sd-Token=[YOUR_APP_TOKEN]"
Make sure to replace the [YOUR_APP_TOKEN] by the application token of your app. It can be found in Settings > Security
Once you have provisioned your API:
- Navigate to My APIs
menu entry. You will see the list of APIs proxified by Streamdata.io for selected app:
- Click Edit
on the API for which you want to set a specific polling frequency:
- You can now change frequency in Polling Frequency Section.
Don't forget to click Save
button after making the change.
We hope that this quick How To will help you take better advantage of Streamdata.io.
As we said in introduction, we are planning to enable configuration via API but also add possibility to define several time frames for the same APIs, giving the possibility to adapt polling frequency depending on the time of the day.
We are continuously looking for enhancements, so feel free to leave your suggestions and comment. Enjoy!