Reputation: 1535
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
Reputation: 9702
You have to check endpoint serilaizer and factory. http://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/dependencies/synapse/2.1.2-wso2v3/modules/core/src/main/java/org/apache/synapse/config/xml/endpoints/
Upvotes: 1