There is a way to get System property expansion in Roller properties.
System property references of the form ${propname} are expanded when
they appear in some (not all) Roller properties.
There is a property called config.expandedProperties that determines the
list of properties that get the expansion treatment. By default this
property is set as follows (you can find this in roller.properties):
config.expandedProperties=uploads.dir,search.index.dir
You should be able to redefine this property as well as the clientId in
roller-custom.properties to achieve what you want.
In your roller-custom.properties, define:
tasks.clientId=${my.clientId.property}
config.expandedProperties=uploads.dir,search.index.dir,tasks.clientId
Your property (my.clientId.property) must be defined as a Java system
property in the JVM by the time that the Roller webapp context initializes.
Not sure if this is enough for you. If you have a startup script that
starts the JVM with -Dmy.clientId.property=`hostname` (assuming a *nix
shell), this may be unique enough if you aren't running multiple
instances on any one host.
Maybe we should add tasks.clientId to the default list of expanded
properties in the distribution. I'm not sure how other people are doing
this right now and if there's a better overall approach to determining
the client id.
--a.
Dick Davies wrote:
Hi, we're running a 2 node GFv2 cluster, and we've got the Roller
weblogger running on both nodes.
How do people generally get around this:
# client identifier. should be unique for each instance in a cluster.
tasks.clientId=defaultClientId
(in roller.properties)?
Since both glassfish instances are running the same WAR file, they
both have the same clientid.
I really don't want to have to write N different WARfiles, so I'm
wondering if there's some way to pick up a system property or something?