I've been using an embedded neo4j server in my project so far. Now I want to try out the new bolt protocol with a standalone server, however only for my deployed application. For convenience, I still want to use an embedded database when running from IDE (permanent) or when running tests (impermanent).
In order to support this, I've migrated from the java based configuration to the use of a ogm.properties file. Depending on the environment I run in, I want to use the file which configures the respective driver/database location.
I have placed a default configuration in the root of my resources folder. However I am not able to "override" this in other environment. In order to do that I placed a different ogm.properties in the root folder of the deployed application. This doesn't seem to work. This the mechanism that I previously already used in order to have different application.properties and logback.xml configurations.
Is this not supported by neo4j-ogm? If not, how can one achieve this? It also isn't (trivially) possible with the java based configuration. I am a bit confused, since this doesn't sound like such an unlikely requirement...
You can use Spring Profile
for this to configure different properties for different environments and you can look here.
You can use application.properties (spring.profiles.active
) to load a different profile or by using a runtime argument if you are using Spring boot with CommandLineRunner.