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
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: 1017
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:
33 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 144

rocket science: 86

pramanj: 86

Francesco Zambon: 83

Ibrahim: 78

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 735

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1510

Posts: 6399

Newest Members:

tammyhillier, rodsFioravanti, Sairamreddy, wj, valentinafluhart, accusneds, Jamesses, DavidLarry, elainesever, powhephenry

Moderators: Jouni Aro: 1019, Pyry: 1, Petri: 0, Bjarne Boström: 1017, Jimmy Ni: 26, Matti Siponen: 340, Lusetti: 0

Administrators: admin: 1