1

I have seen some questions about dynamic adapter configuration at run-time

how to pass domain,port number,username and password from user input to worklight http adapter

With a Worklight Adapter can I change the domain and port for a procedure at runtime?

but my question is about adapter configuration after deploy on WL server 5.0.6 from external - not at runtime from code.

Our scenario is that in our enterprise development and testing process requires the QA and Testing team to change the destination host and port for the adapters from mockup-backend to testing-backend to production-backend regularly during testing.

of course, this should happen through configuration and not re-compile and re-deploy.

Is there a way to change the domain and port values for adapters that are deployed on the WL server 5.0.6? Can this be changed in the WL database tables? Can this be changed in the WL server filesystem somewhere?

since we did not find any solution to that yet, the developer team is already thinking about using the Adapter only as dumb facade and implement all connection to the backend-services in Adapter-side Java using the Java URL and Connection classes. Then it would be easy to read a configuration file from the file system in Java to change the backend destination URL and ports in this file. It would even be easy to read the URL and port from a property in the worklight.properties file in JavaScript and pass it to Java to connect.

I would like to avoid having developing all backend connection code in Java. I would rather see the project use the actual Adapter connectivity features, but I am also not sure how to convince the team since it is quite easy with just 4 lines of code in Java. The advantage of using the Adapter connectivity that can not be configured is hard to see over a own Java implementation in Adapter-Java code.

Thank you.

Community
  • 1
  • 1
christianmenkens
  • 790
  • 4
  • 22

1 Answers1

0

Is there a way to change the domain and port values for adapters that are deployed on the WL server 5.0.6? Can this be changed in the WL database tables? Can this be changed in the WL server filesystem somewhere?

In Worklight 5.0.6, as written in the questions you've linked to in the question, an adapter's connectivity settings cannot be altered. They are stored in the packaged adapter and cannot be read from anywhere else during runtime nor after deployment.

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
  • can you unzip the adapter package on the server - change the XML and rezip? I have openend an adapter package with ZIP often on my developer machine already... the console also shows the connectivity of an adapter - is it maybe stored in the database? where does the adapter take/read the domain and port values from when it is executed? – christianmenkens Jul 05 '13 at 15:10
  • how about the argument that developers would/will switch to Java coding the connectivity instead of using the Adapter - due to that? do you see disadvantages in using Java Connection instead of the provided Adapter connection? .... except the missing System.out.println() functionality I asked as a follow up to a different question.... ;-) – christianmenkens Jul 05 '13 at 15:12
  • It is packaged and stored in the database; when the server is started it is then stored in memory. You cannot alter it in any way. If you have a workaround that works for you, you'll have to use it... – Idan Adar Jul 07 '13 at 06:59