Add durable subscription + transfer WinForms sample - #873
Merged
romanett merged 5 commits intoSep 9, 2026
Merged
Conversation
Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
… engine Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
romanett
September 6, 2026 19:37
View session
romanett
marked this pull request as ready for review
September 6, 2026 19:43
Contributor
|
@copilot fix the failing tests |
Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
Contributor
Author
Fixed in 3b8c18a. Adding the sample to
Tier-0 config tests pass (247/247) and the hosting + client test projects build. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
No sample exercised durable subscriptions or
TransferSubscriptions, thoughdocs/DurableSubscription.mdanddocs/TransferSubscription.mddescribe four client use cases and the server-side support required. This adds a server + client WinForms sample pair underWorkshop/DurableSubscription/covering both documents, built on the V2Opc.Ua.Client.Subscriptionsengine used by the other client samples.ReferenceServerwithDurableSubscriptionsEnabledon, keeping subscriptions and their queued notifications alive while the client is gone. Registered in the solution,SampleCatalog.cs, andConfigurationFileTests(opc.tcp62581/ opc.https62580).CurrentTime; Save & Restart persists it, restarts the process, transfers it back, and flags values queued during the downtime as recovered (classified bySourceTimestampagainst the transfer instant).SampleSessionFactory.ConnectAsync(required for the subscription manager)SampleSession.AddSubscription+SubscriptionCallbacksISubscription.SetAsDurableAsync(TimeSpan)ISubscriptionManager.SaveAsync/LoadAsync(..., transferSubscriptions: true)— snapshot to disk and transfer-back, which drivesGetMonitoredItems/TransferSubscriptionsinternallySession/Subscriptioncalls.The model's public surface is unchanged, so
MainFormwas untouched by the V2 migration.Related Issues
Types of changes
What types of changes does your code introduce?
Put an
xin the boxes that apply. You can also fill these out after creating the PR.Checklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
The client uses the V2 subscription engine for consistency with the other samples; durable/transfer/save-load are all first-class on that engine (
SetAsDurableAsynctakes aTimeSpan, server may revise the lifetime down to whole hours). The self-contained connect/persist/restart flow is kept rather than theSampleClientModelattach/detach pattern, since the demo intentionally kills and restarts its own process.