Hi lakshmi,

its good to see that you have solved your problem. Indeed config library
documentation <https://github.com/typesafehub/config#standard-behavior>
mentions
that config.file system property can be used to change config source.


On Thu, Sep 4, 2014 at 10:03 PM, lakshmi <[email protected]> wrote:

> Actually, it looks like I fixed whatever was wrong by letting the default
> load happen, as it already seems to pick up all configuration files from
> the configuration directory.
>
> In MyApp.java, change from:
>
>  Config configuration = ConfigFactory.parseFile(new File("configuration/
> application.conf"))
>                 .withFallback(ConfigFactory.load());
>
> To:
>         Config configuration = ConfigFactory.load();
>
> - lakshmi
>
>
>
> On Thursday, September 4, 2014 10:32:58 AM UTC-7, lakshmi wrote:
>>
>> Here is the actual config I am interested in overriding:
>>
>> In configuration/application.conf:
>>
>> redis {
>>   back-off-retry {
>>     interval-millis = 100
>>     factor = 2
>>   }
>>
>>   host = "10.200.14.60"
>>   port = 6379
>> }
>>
>> In configuration/application.conf:
>>
>> redis {
>>   host = "127.0.0.1"
>> }
>>
>> - lakshmi
>>
>> On Thursday, September 4, 2014 8:52:44 AM UTC-7, lakshmi wrote:
>>>
>>> Hello,
>>>
>>> I'm using Akka with Java 8. Here is my directory structure and jsvc
>>> command that runs the application as a daemon
>>>
>>> *Directory structure:*
>>>
>>> myapp
>>>  \---------myapp.jar
>>>  \---------configuration
>>>             \----------application.conf
>>>             \----------application-dev.conf
>>> \----------lib
>>>             \----------mylib1.jar
>>>             \----------mylib2.jar
>>> \----------daemon-base.sh
>>> \----------run.sh
>>>
>>>
>>> *application-dev.conf:*
>>>
>>> include "application"
>>>
>>> akka {
>>> ..
>>> ..
>>> ..
>>> }
>>>
>>>
>>>
>>> *Application run command:*
>>>
>>> jsvc.exec -cp /deploydir/myapp:/deploydir/myapp/myapp-1.0-SNAPSHOT.jar:/
>>> deploydir/myapp:/deploydir/myapp/lib/*.jar:/deploydir/myapp/configuration
>>> *-Dconfig.file=/deploydir/myapp/configuration/application-dev.conf*
>>> -Dakka.log-config-on-start=on -pidfile .myapp.pid com.company.myapp.daemon.
>>> MyAppDaemon
>>>
>>> *MyApp.java:*
>>>
>>>         Config configuration = ConfigFactory.parseFile(new
>>> File("configuration/application.conf"))
>>>                 .withFallback(ConfigFactory.load());
>>>
>>> *Log of config on startup:*
>>>
>>>     # merge of configuration/application.conf: 4,system
>>> properties,/deploydir/myapp/configuration/application-dev.conf:
>>> 3,/deploydir/myapp/configuration/application.conf: 4,system
>>> properties,reference.conf: 7-77
>>>
>>>
>>>
>>> As you can see in the jsvc command, I am overriding application.conf by
>>> providing -Dconfig.file. However, when I log the configuration on startup I
>>> see it is actually overriding the other way. I am not sure what the numbers
>>> mean exactly, but at least the final result takes the values from
>>> application.conf instead of application-dev.conf.
>>>
>>> Can you please help me figure out what is wrong with my code?
>>>
>>> Thanks a lot!
>>>
>>> lakshmi
>>>
>>  --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive
<http://www.reactivemanifesto.org/> Apps on the JVM

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to