...
Use this file if you need to set specific project configuration and override default values.
Warning |
---|
It's not possible to define spring.profiles.active property in openhub.properties file. But there are another ways how to tell Spring which profiles should be active. |
Default properties from database
Storing properties
Properties are stored in the table configuration in DB. See Data model for more details about columns of this table.
...
Code Block |
---|
@ConfigurableValue(key = "ohf.asynch.countPartlyFailsBeforeFailed") private ConfigurationItem<Integer> countPartlyFailsBeforeFailed; @ConfigurableValue(key = "ohf.contextCallserver.localhostUri") private ConfigurationItem<String> localhostUri; |
...
Tip |
---|
@Value vs @ConfigurableValue:
Note: Configuration values are cached by Cache, see Hazelcast and "config_params" data structure. In other words you should clear the cache to get new value when you change it. |
Tip | ||||
---|---|---|---|---|
There can be null/empty parameter value (that is optional) and it can be problem to convert null/empty value to target data type. For example:
If parameter ohf.asynch.externalCall.skipUriPattern is empty then it ends with the following expcetion: java.lang.IllegalArgumentException: Cannot convert value [] from source type [String] to target type [Pattern] In these scenarious is better to use String as target data type and compile Pattern by yourselve.
|
...
Tip |
---|
There is application-test-default.properties file in core module that contains default values for unit tests. Why? If OpenHub runs in production mode then default values are taken from database but not all unit tests are using database. Therefore default values in the file is are useful. |