Industry Automation and Control Forum
This forum is addressing industrial automation design & engineering, operations, asset performance, cyber security and digital transformation for Plants & Machines.
Posted: 2019-05-30 05:24 PM . Last Modified: 2019-05-30 07:29 PM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2019-05-30 05:24 PM . Last Modified: 2019-05-30 07:29 PM
Hi,
I'm writing some software to interface with the SmartConnector RESTFul EWS Gateway API. I'm making good progress but I need some guidance on how to best handle Subscriptions.
My understanding of subscriptions is that to Subscribe, I can POST a request that includes the set of value IDs I'm interested in, set up the Notifications and then poll for changes. When I’m done I can send a DELETE and it’s cleaned up.
This is working fine, but I don't know up front the set of values I'll need, and I expect that set to change significantly over a short period of time (it’s a dynamic set, I can’t know what’s needed). So I'm working on a way to optimally subscribe to values when I don't know up front what set of values I'll need, but I can't find a way in the documentation to alter a Subscription once it's been created which has left me stuck.
I've identified a few options to work around this, but none of them really seem right to me. I would very much appreciate some insight!
Option 1. Every time I need a new value I create a subscription just for that value. Seems inefficient, and will create a bunch of overhead trying to manage and poll all those subscription, effectively defeating the purpose.
Option 2. Every time I need a new value I delete my existing subscription and create a new one with the combination of my existing subscription and the new value. Creates a lot of overhead in managing all the creates/deletes and will prevent updates while this occurs.
Option 3. I discover and permanently subscribe to all values available from the API so I never have to deal with this issue. Creates a lot of unnecessary messaging and processing overheads.
Option 4. A hybrid approach where I use Option 1 until I hit a threshold then use Option 2 to keep the number of subscriptions to a manageable level without incurring too much create/delete overhead. Still have issues with unsubscribing values, but it limits impacts. This is what I will do unless I can find a better way.
I'd really like an option 5 that is better than these! The best thing would be a way of altering an existing Subscription to get around the problem.
Is there a best practise way of doing this?
Thanks,
Stuart Jarvis
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2019-06-11 02:59 PM
Dear Jarvis,$
This Community being focused on Industrial Automation, won't be able to provide you any insight about Building Automation topics.
I would recommend you connect with your local sales or Customer Care Center, to get the answer to this issue.
Best regards
Jean-Commeignes
Power & Building Community Manager
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.