How to configure polling frequency

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 sub-entry.
  • You can now set the default polling frequency that will be applied to all newly created APIs. Do not forget to Save!

Default Polling Frequency Configuration

 

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]"

e.g curl -v “https://streamdata.motwin.net/http://stockmarket.streamdata.io/prices?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. You can also use our client SDK or demos to stick to your preferred environment (JavaScript, iOS, Android, Pebble and more). All projects are open-source on Streamdata.io GitHub.

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:

List of APIs

  • Click Edit on the API for which you want to set a specific polling frequency:

API polling frequency

  • You can now change frequency in Polling Frequency Section. Don’t forget to click Save button after making the change.

 

Conclusion

Hope that this quick How To will help you take better advantage of Streamdata.io.

As I 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.

Our technical support team stand ready to assist you with all of your technical questions.

Enjoy!

Share it :
0000

Give it a try!

Try streaming any JSON REST API within 30 sec
curl -v "https://proxy.streamdata.io/http://mysite.com/myJsonRestService?param1=[]&param2=[]"

Leave a Reply

Your email address will not be published. Required fields are marked *