Hello community,
I was wondering if, inside a QA, there is any method/SLNET call to manage the subscriptions under a dma?
Thanks in advance
Hi Bruno,
There are several ways to use subscriptions in QActions.
The recommended way is to use the 'DMS Monitors' feature in the class library. This library also takes care of the cleanup of the subscriptions, which is very important to avoid memory leaks. See above links for more information.
For more advanced subscriptions that are not possible (yet) using above library you could also manage them yourself using the 'protocol.SLNet.RawConnection.AddSubscription()' method. This should only be used when you know what you're doing, and also don't forget to unsubscribe when the element is stopped or restarted.
Subscriptions should always remain active, also (for instance) after an element restart. That's why its so important to clean them up when not needed anymore.
The easiest is probably to keep track of the existing subscriptions yourself in a list or dictionary.
Hello Tom,
I was reading about the Cleanup Configuration documentation, and if that is as stated, that will work for me.
I created a table with a column state to control all my subscriptions.
A Monitor Cleanup Config is by default "attached" to a start monitor call?
Thank you!
Yes, if I'm not mistaken it also automatically subscribes to the element state of the element that creates the monitor. If that element is stopped, all subscriptions are also cleaned up.
Perfect! So I have everything in place.
Thanks
Hello Tom, thank you for your reply.
I am using already class library, however, what I am looking for is a method that guarantees that my subscription over a param is still active…in order to active it again if that breaks anyhow by an element restart.
I know that over Client Test tool it is possible to have "an overview" off all existing subscriptions, and this was the functionality that I was looking for.
Thanks in advance