8:15, EEST
October 15, 2024
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!
10:00, EEST
April 3, 2012
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.
Most Users Ever Online: 1919
Currently Online:
14 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: 740
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
Bernardclila, doylenewbery, mickey21654, donnyredmond08, keesha4235, cheribruce, candacekolb4, Garmcrypto7Zof, calebhardison, susannahdingle7Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1