Dmitry Dmitry - 8 days ago 5
Java Question

How to use custom system property resolver in Wildfly

We use Wildfly 9.0.2 server and we need to use custom property resolver to inject values to system-properties in standalone.xml, to make something like:

<system-properties>
<property name="my-property" value="${custom:property-value-key}" />
</system-properties>


Is there mechanism similar to the one provided by Tomcat (org.apache.tomcat.util.digester.PROPERTY_SOURCE property)?

Thank you!

Answer

Since there is no easy programmatic way to inject custom properties to standalone.xml, we decided to modify startup sh scripts to read data from Consul and set environment variables to WIldfly process and then read them as ${env.QLEO_DB_URL} in standalone.xml.