Initialize Cacheonix programatically

Cacheonix support forum is dedicated to support requests, bug reports and feature suggestions.

Initialize Cacheonix programatically

Postby tarlog » Sun Dec 23, 2012 1:35 pm


I'm currently evaluating the Cacheonix and I have a question regarding the Cacheonix initialization. In documentation appears that Cacheonix can be configured using xml file. Can it be loaded programatically?
Can it be reloaded?

Both cases can be very useful in cluster.


Postby support » Thu Dec 27, 2012 8:09 pm


Right now the only way to configure Cacheonix is through the XML file.

Could you tell a bit more about what configuration parameters would you like to be able to change? Can you provide any [pseudo]code examples of how the API should look like?



Postby tarlog » Sun Dec 30, 2012 12:49 pm

Actually I would like to be able to set any configuration parameters programatically. One way to do so, is to pass the whole xml file during the configuration (as a string).

The motivation is simple: if I want to share the same configuration between several nodes, it would be easy to keep it in the database and load during the servers start-up.


Postby simeshev » Mon Dec 31, 2012 5:02 pm


When you say 'set any configuration parameters programatically', do you mean setting the configuration on startup, or modifying them dynamically at runtime? I am asking because a) there is a growing number of parameters that are replicated and cannot be changed on per-server basis and b) changing some parameters may require internal re-start of the server.

If you are interested in just having a configuration that is shared between multiple servers, Cacheonix supports a URL as a path to configuration, so you can place it on a web server or a network share.




Postby tarlog » Tue Jan 01, 2013 11:11 am

Modifying configuration at runtime can be neat, but not a must.

IMO, the preferred option to share the configuration, is to load it from the database. I would certainly not expose a web service, just to share the configuration. Network share is a possible way, but it's requires some configuration made at network level, which may not always be possible.

I strongly recommend to add the ability to configure the Cacheonix programatically to the backlog :)


Postby simeshev » Thu Jan 03, 2013 4:57 pm

tarlog wrote:IMO, the preferred option to share the configuration, is to load it from the database.

Makes sense. Would it make easier if we exposed loading the configuration from an InputStream? Then you'd be able to write the string containing Cacheonix configuration to a column in a database, read it and pass it to Cacheonix. Or, would you like some other API?



Postby stodge » Fri Jan 25, 2013 1:31 pm

Another option is to provide a Configuration class, with a method setProperty("prop_name", "prop_value"). Although it might be easier to provide a Configuration class with setListenerTcpPort(8888) and setMulticastAddress(), setMulticastPort() etc.

Return to “Cacheonix Support”

Who is online

Users browsing this forum: No registered users and 2 guests