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
PubSub: Multiple PubSubSystems with 1 ea. connection vs.1 PubSubSystem with multiple connections
June 5, 2026
14:51, EEST
Avatar
hbrackel
Member
Members
Forum Posts: 158
Member Since:
February 21, 2014
sp_UserOfflineSmall Offline

When an application requires multiple connections (e.g. publishing on multiple UDP multicast addresses or subscribing from multiple multicast addresses) options would be to create either a single PubSubSystem with multiple connections or multiple PubSubSystems with one connection each.

Are there any benefits of one over the other option apart from the possibility to start/stop each individually or together?

June 9, 2026
11:03, EEST
Avatar
Lusetti
Moderator
Members

Moderators
Forum Posts: 8
Member Since:
May 5, 2020
sp_UserOfflineSmall Offline

Hi hbrackel,

My educated guess is that a singular PubSubSystem is the cleaner option since that supports your stated requirement of handling multiple connections. Do you have more requirements left unstated in the message? If you have something specific to point out, I could try to take a look and see if I can something more specific related to that.

P.S.
If you wish to wait, you’ll likely get a more nuanced and direct answer once relevant people return from vacation đŸ™‚

June 9, 2026
12:40, EEST
Avatar
hbrackel
Member
Members
Forum Posts: 158
Member Since:
February 21, 2014
sp_UserOfflineSmall Offline

Hi ‘Lusetti’,

thanks for your reply.
We need to add connections (subscribers on additional multicast addresses) on the fly, while the subscriber/s on the first connection is/are already active. It is my understanding that the PubSubSystem configuration is, once created, mostly immutable. Adding a second connection would probably mean to stop the first PubSubSystem, update the configuration (or even create a new one if an update is not possible) and then start the new configuration with the added connection. Having multiple PubSubSystems would avoid that interruption.

June 9, 2026
14:01, EEST
Avatar
Lusetti
Moderator
Members

Moderators
Forum Posts: 8
Member Since:
May 5, 2020
sp_UserOfflineSmall Offline

Hi hbrackel,

One PubSubSystem with multiple connections appears to support adding connections on the fly without stopping existing ones. Multiple PubSubSystems are not required just to avoid interruption when adding another multicast subscriber, based on the implementation. Additionally the docs show that the configuration updates are applied live meaning start/stop shouldnt be required when adding connections:

https://documentation.prosysop…..bFunction-

Of course, multiple PubSubSystems could provide better Application-level isolation (e.g. if you want separate life cycles/listeners for each connection) but based on your question, a single one should be suitable.

July 6, 2026
14:38, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1114
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Adding few extra notes, though mostly it is as said above.

The configuration can be changed via PubSubSystem.updateConfiguration(..). That method will take a function, which receives the current live configuration as input (PubSubSystemConf) and it must output the desired new configuration (PubSubSystemConf) or throw PubSubException to abort. Once the function outputs the desired state, PubSubSystem will internally create/modify/remove connections/groups/writers/readers to match the new configuration (or throws PubSubException, if that fails for some reason).

The design was to allow multiple concurrent update operations from multiple threads. Due to intentional synchronizations, only one of the update-functions runs at a time, but they would always see the result of the previous function output as their input. This would have been a need for making an address space -based configuration, since each Write/Call operation happens on the blocking-work threads. Though, nowadays it mostly enables SDK itself updating the configuration as that is used to store received metadatas.

Thus, in general one PubSubSystem should be enough. If for some reason the updating doesn’t work, let us know.

P.S.
Since the PubSubSystem takes the UaApplication (UaClient/UaServer), if you have multiples in a single application, then you would need a PubSubSystem for each. Skipping some details regarding Subscriber side for now. Skipping also some details regarding MQTT.

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: 149
rocket science: 128
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 912
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1599
Posts: 6757
Newest Members:
wp_admin_29d15d, wp2_710f74db8f4f, w2s_b88424ddd2f6, w2s_3023cd8e25c6, wp2_9adf65dd68b9, wp_mass_8c765122b4c8, wpsvc_1ac66b6663d9, cacheops0cc768, wpsvc_7c3af69726d8, wp_admin_4d8e61
Moderators: Jouni Aro: 1059, Pyry: 1, Petri: 1, Bjarne Boström: 1106, Jimmy Ni: 26, Matti Siponen: 372, Lusetti: 1
Administrators: admin: 1