Antony Jones
2014-04-04 16:38:41 UTC
Hi All.
I've been forced to look at loading an external properties file to
configure various attributes within Grails in the last week or so, and I
was quite amazed by some massive inconsistencies I've had to overcome.
Firstly there is the datasource confguration. If you want dbCreate to be
acknoweldged - you cannot externalise the configuration. It simply doesn't
create the tables for you if you are using create-drop.
Secondly dataSource again - I want to externalise the URL, and if I do so -
I can't have a value in config like 'use external value' as it will try to
connect to it first and fall over - probably because of the above problem?
Thirdly I want external config to load and override values in my Config
file - as the documentation says it should. However plugins, such as my own
'oauth' plugin demonstrate that this doesn't happen immediately. I have
checks for null values on the oauth config and every single one fails and
causes the server to terminate. These checks are done at service level so
for some reason - spring is wiring BEFORE the configuration has been
properly set from the external values?
These issues aren't obvious from the documentation, and are even less
obvious from a convention over configuration standpoint.
Is something perhaps going horribly wrong, or is this expected behaviour?
The ordering seems a bit crazy.
Cheers,
Antony
I've been forced to look at loading an external properties file to
configure various attributes within Grails in the last week or so, and I
was quite amazed by some massive inconsistencies I've had to overcome.
Firstly there is the datasource confguration. If you want dbCreate to be
acknoweldged - you cannot externalise the configuration. It simply doesn't
create the tables for you if you are using create-drop.
Secondly dataSource again - I want to externalise the URL, and if I do so -
I can't have a value in config like 'use external value' as it will try to
connect to it first and fall over - probably because of the above problem?
Thirdly I want external config to load and override values in my Config
file - as the documentation says it should. However plugins, such as my own
'oauth' plugin demonstrate that this doesn't happen immediately. I have
checks for null values on the oauth config and every single one fails and
causes the server to terminate. These checks are done at service level so
for some reason - spring is wiring BEFORE the configuration has been
properly set from the external values?
These issues aren't obvious from the documentation, and are even less
obvious from a convention over configuration standpoint.
Is something perhaps going horribly wrong, or is this expected behaviour?
The ordering seems a bit crazy.
Cheers,
Antony
--
________________________________
êœ . antony jones . http://www.enzy.org
________________________________
êœ . antony jones . http://www.enzy.org