Avatar
Please consider registering
guest
sp_LogInOut Log Insp_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 RSSsp_TopicIcon
Title: How to Stop Browsing During connect() in Prosys OPC UA SDK (v5.2.6) - Spring Boot with Java 21
October 15, 2024
8:15, EEST
Avatar
Sairamreddy
New Member
Members
Forum Posts: 1
Member Since:
October 15, 2024
sp_UserOfflineSmall Offline

Hello Prosys community,

I am currently working with Prosys OPC UA SDK v5.2.6 in a Spring Boot application running Java 21. In my use case, the connect() method seems to initiate some automatic browsing behavior, which I would like to control or stop manually.

Problem:
During the connection process, I observe that browsing automatically starts, leading to performance delays, especially when there are many nodes or when the server has a large hierarchy. I want to either:

Stop browsing entirely during the connection phase.
Manually control browsing, i.e., decide when to trigger the browse operation after the connection has been established.

What I’ve Tried:
I have explored manual browsing methods, but once the connection starts, browsing still seems to happen automatically before I can intervene.
I considered using session listeners or threading (with CompletableFuture), but these approaches only help in managing browsing after it starts, not in preventing or stopping it during connection.

My Question:
Is there any way to completely disable automatic browsing during the connect() method in Prosys OPC UA SDK?
Alternatively, is there a mechanism to stop or interrupt the browsing once it starts during the connection process?

Environment Details:
Prosys SDK Version: 5.2.6
Java Version: 21 (running virtual threads as well in some scenarios)
Framework: Spring Boot

Additional Considerations:
I am working with around 10,000-20,000 NodeIds and need to optimize performance during the connect and browse phases. Any guidance or best practices for handling large numbers of nodes with the Prosys SDK would be appreciated.

Looking forward to your advice and any potential solutions.

Thank you!

October 15, 2024
10:00, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1047
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

How long it takes and how long you wish it would take?

We do Read&Browse all Types during connect by default (skipping some details in this post). Technically there is a way to disable this via:
UaClient.setInitTypeDictionaryOnConnect(false);
UaClient.setInitTypeDictionaryAutoUsage(false);
Though doing that loses support for custom Structures and there is a (potentially larger) latency penalty on first encounter of any Type if you use ‘UaNodes’ since we must Read&Browse things related to it.

IF you just wish to do some decision after connection, this should allow you do do it:
client.setInitTypeDictionaryOnConnect(false)
client.connect();
And then immediately after
client.getTypeDictionary().init();
before you do anything else with the UaClient instance should leave you with a similar state than the default.

If you never use UaNodes nor have the need for custom Structures you can set both flags to false without any downside.

P.S.
SDK has lot of uses of ‘synchronized’ keyword, while my knowledge is a bit limited, that can pin virtual threads. So SDK doesn’t “support” them, sort of, but things probably still like work. Once/if https://openjdk.org/jeps/491 arrives it should help things.

Forum Timezone: Europe/Helsinki
Most Users Ever Online: 1919
Currently Online:
Guest(s) 31
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 90
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 734
Moderators: 8
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1545
Posts: 6521
Newest Members:
wilfredoforeman, ptdenriqueta, basilpullman, Richardmip, mood edibles, LouieWreve, daniellabdx, janessan21, sammiebeak359, gena7127517
Moderators: Jouni Aro: 1029, Pyry: 1, Petri: 1, Bjarne Boström: 1047, Jimmy Ni: 26, Matti Siponen: 353, Lusetti: 0, Elias: 0
Administrators: admin: 1