Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
OnMissingData on subscription
October 28, 2022
14:00, EEST
Avatar
Xavier
Member
Members
Forum Posts: 43
Member Since:
March 26, 2014
sp_UserOfflineSmall Offline

Hello,

Regarding the onMissingData of SubscriptionNotificationListener, the javadoc says:
“Notification of a missing notificationData packet. The method is called, when the client notices that a notification data packet has been missed and is no longer available from the server.” and then “You should return 0 or (modified) newSequenceNumber if you wish to proceed with Republish.”.

To be sure, when the onMissingData is sent, and if I return 0, does it try once more a republish or is it already sure that the data are lost?

On this old topic there were some advices about how to try to resync the subscription, but are there new possibilities with the updates in the SDK ?
https://forum.prosysopc.com/forum/opc-ua-java-sdk/republishrequest/

Thank you.

October 28, 2022
14:51, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

If the Republish fails, it means that the notification is no longer on the server and thus cannot be recovered (other than via a HistoryRead, if the server supports that). Jouni might have to do follow-ups, as this functionality is very old, however I believe the intention is to control if we would even try to Republish potentially _other_ (newer time-wise) notifications that are also lost i.e. you could skip them by returning the “sequenceNumber” parameter, but you could return it sequenceNumber-1 to try to recover the last message for example.

Nowadays, assuming the server supports it, there is ResendData method (https://reference.opcfoundation.org/Core/Part5/9.2/), some quite recent SDK version added Subscription.resendData() as a helper. Though, I should note the wording of ResendData has changed in spec versions (and I think it is still … sort of wrong in the wording). But the main point of it would be that the next time the Subscription for which ResendData was called publishes, it would send a value for all MonitoredItems. However, all that is just give “a value” to the items, if the notification was lost and could not be republished the data is lost. Not sure if this is a problem for you, but if it is the only way to recover that would be via HistoryRead and the server would have to support it.

P.S.
I would also say as a purely personal opinion that if a use-case requires to get “all data points of a node”, then the only way to do it would be via HistoryRead, because sampling could miss a change (unless the server supports interval 0). So basically you would periodically HistoryRead from current time to the last known value etc. Though, this has the downside that it has maybe a bit more latency depending on the HistoryRead interval (and it does produce a bit extra work for the server as well); and not all servers do support history.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
17 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 680

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6260

Newest Members:

sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com, aytule

Moderators: Jouni Aro: 1009, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1