Question

I am using built Worklight adapters with proxy settings specified in the adpater xml files but for differing environments I need to change them and/or turn them off. The goal is not to have the adapter files rebuilt for new environment but just reconfigure existing ones. Leaving part of the proxy setting blank on build fails.

if the proxy settings in the adapter are

<proxy>
   <protocol>${adapter.proxy.protocol}</protocol>
   <domain>${adapter.proxy.domain}</domain>
   <port>${adapter.proxy.port}</port>
</proxy>

and the following are set in worklight.properties

adapter.proxy.protocol=http
adapter.proxy.domain=mydomain
adapter.proxy.port=8080

Then setting jndi properties in the server.xml file to over write them has no affect in over writing them.

<jndiEntry jndiName="worklight/adapter.proxy.port" value="9080" />
<jndiEntry jndiName="worklight/adapter.proxy.domain" value="newdomain" />
<jndiEntry jndiName="worklight/adapter.proxy.protocol" value="http" />

Is there a way to manage these proxy settings without rebuilding the adapters using a similar mechanism?

Was it helpful?

Solution

Once you add an element to the adapter XML, it has no "off switch".

Also, you cannot change an adapter XML properties' values during runtime. Meaning, once the adapter is deployed, you cannot change its properties. You must re-build for new properties to be used.

That said, you can place properties in the XML and overwrite them, so that during the adapter deployment, they will change based on the environment. Which is what you've depicted in the question. That, should work.

Make sure you follow this guide, or the equivalent for the Worklight version that you are using (since you did not mention it...): Configuring an IBM Worklight project in production by using JNDI environment entries

Related questions:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top