Difference between "System Properties" and "Instance Properties"

312 views
Skip to first unread message

David Sharpe

unread,
Jul 5, 2019, 4:08:40 PM7/5/19
to Payara Forum
Hello everyone,

I'm wondering if anyone knows what the difference between "System Properties" and "Instance Properties" in the DAS. My organization attempts to run the same application on multiple instances, so we have things like "HOOPC-Dev-1" and "HOOPC-Dev-2". In the case of the DEV environment, both instances are actually on the same physical server.

I need the application to be able to identify itself with an identifier in a specific format, e.g. "hpcd1", "hpcd2", etc. I have set a System Property, which can be retrieved with System.getProperty("property_name"), but naturally I'm wondering if I should use a "System" or "Instance" property for this purpose.



Regards,
David

Ondro Mihályi

unread,
Jul 5, 2019, 5:29:23 PM7/5/19
to David Sharpe, Payara Forum
Hi David,

If you want to set a system property, use the System properties tab. It will set system properties just for that particular instance.

The tab Instance properties doesn't set system properies at all. These "instance" properties are just added into internal configuration of each instance and are used by internal components of Payara Server. For example, instance properties are used internally by the server configuration source of Microprofile Config. These values wouldn't be set as system properties but could be retrieved by Microprofile Config API: https://docs.payara.fish/documentation/microprofile/config.html (note that if you set system properties, they can also be retrieved by MicroProfile Config API directly. The difference between system and instance properties here is that both are visible via the Config API but only system properties are visible via System.getProperties(). Another difference is that when using instance properties, the key should be prefixed by payara.microprofile. to be interpreted as config values. )

In newer versions of Payara Server, there's additional tab MicroProfile properties, where you can define server scoped properties for the MicroProfile Config API directly, without using a prefix for instance properties. These config properties can be also defined in the MicroProfile section for each configuration, for all configuration sources (scopes) in one place.

So, there are 3 types of instance properties:

- System properties - it's what it says, sets Java System Properties for the instance's JVM
- Instance properties - adds properties to a map assosiated with the instance object. Doesn't set Java System Properties. Only accessible via internal Payara API and can also be retrieved by other instances in the domain if they have a handle to the instance. In the past, the old GlassFish clustering mechanism used Instance properties. In Payara Server 5, I think only MicroProfile Config uses them for instance config under the hud
- MicroProfile properties - only in newer Payara Server versions. Used to configure the MicroProfile Config source that provides values for all applications deployed on the instance. Uses Instance properties under the hud, so each MicroProfile property can also be configured as an Instance property with payara.microprofile. prefix

I think we should add this to Payara Server docs...I'll add it when I have some time.

Best regards,
Ondro

pi 5. 7. 2019 o 22:08 David Sharpe <nim...@gmail.com> napísal(a):
--
You received this message because you are subscribed to the Google Groups "Payara Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to payara-forum...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/7eb369d5-8e60-4eae-a12f-08c703803504%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages