MonitoredItemsare used to monitor Variable Valuesfor data changes and event notifier Objectsfor new Events. Subscriptionsare used to combine data changes and events of the assigned MonitoredItemsto an optimized stream of network messages. A reliable delivery is ensured as long as the lifetime of the Subscriptionand the queues in the MonitoredItemsare long enough for a network interruption between OPC UA Clientand Server. All queues that ensure reliable delivery are normally kept in memory and a Serverrestart would delete them.
There are use cases where OPC UA Clientshave no permanent network connection to the OPC UA Serveror where reliable delivery of data changes and events is necessary even if the OPC UA Serveris restarted or the network connection is interrupted for a longer time.
To ensure this reliable delivery, the OPC UA Servershall store collected data and events in non-volatile memory until the OPC UA Clienthas confirmed reception. It is possible that there will be data lost if the Serveris not shut down gracefully or in case of power failure. But the OPC UA Servershould store the queues frequently even if the Serveris not shut down.
The Method SetSubscriptionDurabledefined in OPC 10000-5is used to set a Subscriptioninto this durable mode and to allow much longer lifetimes and queue sizes than for normal Subscriptions. The Methodshall be called before the MonitoredItemsare created in the durable Subscription. The Servershall verify that the Methodis called within the Sessioncontext of the Sessionthat owns the Subscription.
ModifySubscriptioncan be used to change the parameters of the durable Subscription. If the Clientwould like to keep the previous life time setting, the Clientneeds to calculate the LifeTimeCountbased on the revisedLifeTimeInHoursand the PublishingInterval. ModifySubscriptiondoes not change the durable mode of the Subscription.
- Support the SetSubscriptionDurable Methoddefined in OPC 10000-5
- Support Service TransferSubscriptions
- Support long Subscriptionlifetimes, minimum requirement are define in OPC 10000-7
- Support large MonitoredItemqueues, minimum requirement are define in OPC 10000-7
- Store Subscriptionssettings and sent notification messages with sequence numbers
- Store MonitoredItemsettings and queues
- Use the SetSubscriptionDurable Methoddefined in OPC 10000-5to create a durable Subscription
- Close Sessionsfor planned communication interruptions
- Use the Service TransferSubscriptionsto assign the durable Subscriptionto a new Sessionfor data transfer
- Store SubscriptionId, MonitoredItemclient and server handles and the last confirmed sequence number