Got Hima
Got Hima

Reputation: 127

Replacing a polling event source when upgrading MobileFirst JavaScript adapter from 7.1 to 8.0

In our existing MFP 7.1 project, we're relying on the polling event source in a JavaScript adapter to create a scheduler which enables an interval-specific operation such as watching over a database table for new records to process at server side. The implementation was based on the following guide: http://www.ibm.com/support/knowledgecenter/SSHS8R_7.1.0/com.ibm.worklight.dev.doc/devref/t_configuring_a_polling_event_source.html

However, we discovered that polling event source is nowhere to be found in the MFP 8.0 documentation and the following document states that polling event source is no longer supported: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/product-overview/release-notes/deprecated-discontinued/

We would like to know what is the recommended approach to migrate from 7.1 to 8.0 when dealing with polling event source such as this, and what is the alternative way suggested if there is no possible way in MFP 8.0. Thanks.

Upvotes: 1

Views: 78

Answers (1)

Idan Adar
Idan Adar

Reputation: 44516

Polling is indeed not supported in MobileFirst Foundation 8.0.
https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/upgrading/migrating-push-notifications/

I don't have any official alternative, but since polling is the checking of some backend for new content and if true, then have a notification dispatched, you can still create some service of your own to check your backend if there is a new "record" or new otherwise new content, and if true, the construct a JSON for that notification and send it.

In v8.0 you have multiple REST endpoints you could use together with Confidential clients to send it.

You can also take a look at the following way of constructing a mechanism to send notifications using Node.js: https://mobilefirstplatform.ibmcloud.com/blog/2016/10/18/using-mff-8-push-service-rest-api-in-a-nodejs-based-server/

Upvotes: 1

Related Questions