13:29, EEST
April 1, 2015
I’m trying to get a sample application running with the Prosys OPA UA Java SDK (2.1.0) that demonstrates a server’s ability to automatically re-transmit / re-publish events that were not successfully received by the client due to short network faults. These network faults are long enough for the client to detect a subscription timeout (SubscriptionAliveListener#onTimeout is called on the client), but short enough for the server to keep the subscription and session open, enabling the session and subscription to be re-assigned to the client when it automatically reconnects.
My server sets up some variable and alarm nodes. My client creates a subscription which monitors these nodes.
What works: the client receives events via MonitoredEventItemListener#onEvent / SubscriptionNotificationListener#onEvent when the network is stable. When I simulate a temporary network fault by dropping all TCP packets on the port my application is using, the client’s TCP channel to the server dies, but afterwards successfully reconnects and gets assigned to the same subscription (same ID) that it originally had. Events triggered after the simulated network fault are also received by the client.
What doesn’t work: events triggered by the server during the network fault do not get received by the client after the network is stable again. My client’s SubscriptionNotificationListener#onMissingData method is called, indicating that it knows that data is missing, but was unable to get it for some reason. I read that missing event data should be automatically requested by the client with the RepublishRequest. I added a RequestResponseListener on my server to check which requests are being made and I do not see any RepublishRequests being processed. I also turned up some log levels to try to find out what’s happening in the background but didn’t see any indication that something’s being re-transmitted – but maybe I just didn’t enable enough logging.
I’ve used the default client and server settings, but also tried it with client KeepSubscriptions=true, subscription RetransmissionEnabled=true, PublishingEnabled=true, etc. without any luck. Does anyone have an idea why this doesn’t work for me? Does the Prosys OPC UA Java SDK really support this republish-feature out-of-the-box or would I need to implement a solution somewhere?
13:46, EEST
April 1, 2015
Note: I’m noticing that the server frequently logs an INFO message that sounds somewhat bad:
Acknowledge on Subscription 1: 2 – Bad_SequenceNumberUnknown
I’m seeing this not just in my own sample application but also in the official Prosys sample application. I don’t think I ever saw this in version 1.5.0, but that version had a different problem with subscriptions: that version always created a new subscription on client auto-reconnects, rather than re-assigning an existing one.
14:39, EEST
December 21, 2011
I tried to reproduce this issue, but could not: events are arriving late after the communication is re-established, if the subscription just stays alive in the server. I tested with the SampleConsoleServer and SampleConsoleClient; listening to Server object for events. I can see this kind of INFO level message in th blog:
onMissingData is an indication that the client indeed missed some notification packages and could not republish them from the server. RetransmissionEnabled should be true by default.
I did find out, though, the reason for the Bad_SequenceNumberUnknown warnings: seems that the client is acknowledging alive messages as well, which results to same sequence numbers being acknowledged several times. This should not affect the notifications, though.
If you wish to try the fixed version, you can send email to uajava-support at prosysopc.com to get a beta version.
Most Users Ever Online: 1919
Currently Online:
24 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 738
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1524
Posts: 6451
Newest Members:
jonathonmcintyre, fannielima, kristiewinkle8, rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettingerModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0
Administrators: admin: 1