Alex
Alex

Reputation: 1535

WSO2 Programmatically Update an Endpoint Configuration

I wrote these code lines for accessing and modifying programmatically the load balanced endpoint configurations saved in my esb (4.7.0) local registry. [in a few words i add a new address endpoint to the load balance endpoint list]

    SynapseConfiguration sc = synapseMsgContext.getConfiguration();

    LoadbalanceEndpoint le =(LoadbalanceEndpoint) sc.getEndpoint("test");       
    List<Endpoint>list = le.getChildren();
    AddressEndpoint ad = new AddressEndpoint();
    EndpointDefinition  def = new EndpointDefinition();        
    def.setAddress("http://172.17.54.101:8083/RestService/rest/servizio");
    def.setAddressingOn(false);
    def.setTimeoutAction(100);
    ad.setDefinition(def);
    list.add(ad);
    le.setChildren(list);
    sc.updateEndpoint("test", le);
    synapseMsgContext.setConfiguration(sc);

By this code lines the endpoint's updates are held in memory and lost when i restart the ESB. So this update lastes only till the esb is stopped.

How can i make these updates persistent? I mean an effective update on the endpoint xml configuration file?

Upvotes: 1

Views: 380

Answers (1)

Related Questions