How to have a centralized properties file

Posted by smahanta on 17-Jun-2010 05:43

We have a distributed sonic deployment - ie containers deployed in different machines.Most of the services in their start method read one or other property file.In each container we have defined a system vaiable named "PROPERTY_FILE_PATH" which is the directory path for the property files.

This works.But we put only the property files which are needed for the containers deployed in that particular box.

If it were possible to keep all the property files in one box, that would have helped.

I would appreciate any suggestion in this regard.

Thanks,

Subhendu

All Replies

Posted by tsteinbo on 17-Jun-2010 06:45

you would want to put your properties file into the sonic file system. You then can create an init or runtime paramter of type file resource. You configure it by pointing to the  properties file in the sonicfs. Last, you read the properties file by doing XQContext.getParamters().getParamter(...).

Thomas

Posted by sathish_c02 on 05-Nov-2012 03:37

Hi Thomas,

Is it possible to create a file in the sonic file system at runtime?

Posted by tsteinbo on 05-Nov-2012 07:21

This is possible in principle. It will require a write connection to the DS and some use of either undocumented classes or the use of the deploy tool APIs. Given that you need a write connection (aka Admin connection) to the DS that is not something we do encourage by default.

What is your use case here? Maybe there are alternatives.

Thomas

Posted by sathish_c02 on 06-Nov-2012 03:39

Hi Thomas,

Thanks for your reply. I want to do a xsl transformation. The stylesheet will be deployed in the artifacts path of the correspoding project as you know. The stylesheet has two document variables which is my input xml files(i could not use messages due to some constraints so using files). I want the input xml to be created at runtime in the same path where my xsl will be deployed. Is there a recommended way around. I tried many ways but with no luck. Could not proceed further.

Regards,

Sathish C

Posted by tsteinbo on 06-Nov-2012 04:01

Well, it sounds like your input is temporary and just needs to exist for the life time of the transformation. If this is the case have you considered creating it just in memory as part of the XSLT transformation itself (e.g. just hold it in a variable). If the file is too large you should consider putting it to the local file system instead. I suggest using e.g. the OS's temp directory to store it.

Last, for cases like this I don't recommend using the DS as storage. The DS is not optimized for frequent writes. It does perform well on reads though.

Thomas

Posted by sathish_c02 on 06-Nov-2012 11:36

Thank you very much for your suggestion. Sounds better.

Sathish C

This thread is closed