0
votes

I have a clustered environment that has two WebSphere Application Servers.

In side the Process definition > Java Virtual Machine > Custom properties section for my servers I store several properties.

Is there any way to share values in this section between two app servers?

2

2 Answers

0
votes

I don't think you can share JVM custom properties among multiple servers. However, you can create WebSphere variables (Environment > WebSphere Variables). When you create a variable there, you can choose a scope that will allow the variable to apply to multiple servers. That variable won't work the same as a JVM custom property, so what happens next depends on how the variable is used. If you need to access the variable inside the application, see this link:

http://www.slightlytallerthanaverageman.com/2007/04/02/access-websphere-variables-in-j2ee-applications/

If you need it to act like a JVM custom property, WAS might do variable expansion on JVM custom proerties. Say you defined a WebSphere variable named "WAS_VAR_X" and needed that variable to be set as a JVM property named "jvmPropertyX." You might be able to define the JVM custom property with:

Name: jvmPropertyX
Value: ${WAS_VAR_X}

I haven't tried this myself, so if you try it and it doesn't work, reply so I can edit the answer.

-1
votes

Maybe you can use database/cache(redis, etc) storing the share value.

When the app startup, load properties from database/cache(redis, etc).

Also you can change the properties and the other server can load new shared values.