IBM Worklight - How to change dynamically domain/hostname to which the adapter connects from the client at launch or runtime?

后端 未结 4 1258
耶瑟儿~
耶瑟儿~ 2020-12-11 08:25

When configuring WL HTTP Adapters, the domain and port are part of the adapter configuration .xml file build and uploaded on the WL server. For our use case (especially beta

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-11 09:11

    Update: This answer is useful, so I leave it here for reference, but accept that it doesn't correctly answer this question!

    There is a specific Worklight feature designed to address your scenario (for the Infocenter detail, see here).

    You can do this by using a combination of worklight.properties and JNDI properties.

    For example, let's say you had this setup in your adapter XML:

     
            
                ${my.adapter.protocol}
                ${my.adapter.domain}
                ${my.adapter.port}         
            
            
     
    

    You then define default values for these in your worklight.properties file (in the server/conf directory of your Worklight project, and "burnt in" to the .WAR file when you build it):

    my.adapter.protocol=http
    my.adapter.domain=some.host.com
    my.adapter.port=80
    

    You can then override these values in individual environments, by setting JNDI properties. For example, if you are using WebSphere Liberty, you might put this in your server.xml:

    
    
    
    

提交回复
热议问题