

17:57, EET

December 7, 2023

Hi,
I would like to monitor all sessions and subscriptions of an OPC-UA server. This monitoring should take place because different customers connect with their clients.
The sessions can be read very easily with the following command:
Collection sessions = UaServer.getSessionManager().getSessions();
I have not found such an easy way for the subscriptions.
The current way is via “SubscriptionManagerListener”, i.e. to save subscriptions in a list after they have been created.
However, when the server with the software is restarted, old, previously created subscriptions can be reconnected and these cannot then be recognised via the “SubscriptionManagerListener”.
Is there a way to read out all existing active subscriptions?
Thanks,
Andreas
10:30, EET

April 3, 2012

Hi,
No, but maybe we can add something in the future.
However, the com.prosysopc.ua.server.SubscriptionManager.addListener(SubscriptionManagerListener) way should work, unless I’m missing something here. Just make sure to add it between UaServer.init() (creates SubscriptionManager) and .start() (starts to listen to incoming connections), then you should see all “reconnected subscriptions” adds as well (because clients cannot connect until .start is called). Subscriptions are not persisted over restarts, thus any “reconnected subscription” is a new Subscription as far as the server is concerned and would be notified via com.prosysopc.ua.server.SubscriptionManagerListener.onAddSubscription(ServiceContext, Subscription).
1 Guest(s)
