Neo4j configure performance properties in embedded Spring-Data application - neo4j

How can I configure properties like neostore.nodestore.db.mapped_memory or nodeostore.relationshipstore.db.mapped_memory as described at http://docs.neo4j.org/chunked/stable/configuration-io-examples.html?
I am using the Spring Cineast-Demo-Project.
I guess, I have to configure it in applicationContext.xml, where is also the neo4j store defined:
<neo4j:config storeDirectory="target/data/graph_1000_nodesEdges.db" />
Any hint, where I can configure these performance-parameter?

Look at this link, example 2.1.8, it shows how to pass configuration parameters to the neo4j engine.

Related

security.xml to java config how to reference position="LAST"

So, I'm trying to migrate to Spring Security 4.0.4 and use java config in stead of security.xml
How do I implement
<custom-filter ref="userAgentFilter" before="LAST" />
in java config
http.addFilterBefore(new UserAgentFilter(),LAST??)
There is no concept of "LAST" in Spring Security Java Configuration. Everything is ordered based on the Filter class. Instead, you can insert it after your last Filter. For example
http
.addFilterAfter(filter, SwitchUserFilter.class)

Grails 3 (GORM) datasource properties not loading from Spring Cloud Config Server

I am trying to use Spring Cloud Config Server to externalize my Grails 3 (personnel) application configuration, but I cannot seem to set the dataSource properties.
Currently, I can load other properties (sample.message) into my Grails 3 (personnel) application and retrieve them using grailsApplication.config.sample.message without an issue. And hitting the REST endpoint on the Config Server (localhost:8888/personnel/master) is showing the configuration information I want, so I'm a bit confused.
I have tried each of the following in my personnel.properties file in my Git repo:
datasource.user=example
datasource.password=example
grails.datasource.user=example
grails.datasource.password=example
spring.datasource.user=example
spring.datasource.password=example
But none of them work. I continue to see error messages saying sa#localhost (using password: no) suggesting that the datasource properties, in particular, are not working.
I know it is possible with spring-boot-starter-data-jpa, so I'm wondering:
Is it possible with GORM?
If so, do I need to manually create the datasource bean?
What property names do I use datasource.user, grails.datasource.user, spring.datasource.user, etc?
After Shashank's edit, I realized that it was an issue with my property settings. datasource should have been dataSource and user should be username. Once those corrections were made, the application (personnel) worked perfectly. So,
Yes it is possible.
No, you don't need to create the bean manually
Property names are:
personnel.properties
dataSource.username=example
dataSource.password=example
dataSource.url=jdbc:mysql://localhost:3306/personnel

Add servlet filter to Neoj4 server (v2.1.5)

I'm developing an unmanaged extension for Neo4j.I get start with the tutorial and write a test unmanaged extension that works very well.
For some reasons,I need to add filter on requests.for example:
Execute request in transaction(like OpenSessionIView in J2EE+Hibernate environment)
Convert some chareters(like UpperCaseFilter)
...
Some people have same problem and suggest using PluginLifecycle(1,2). But my Neo4j version is 2.1.5 and this class was deprecated.
Is there any better way to add servlet filter to Neo4j server.
You can still use it, the deprecation has documentation purposes but the class will stay there until there is an alternative.

How can use Flyway with grails

I know there is a Flyway2 plugin. However im not satisfied since it seems fitted for working by console commands. What i want is to integrate Flyway in a programatic way so:
1st Integration tests use flyway to handle db schema with H2 database
2nd Flyway get's triggered on tomcat deployment and handles also the environment database (maybe through running it from bootstrap?)
Does anyone has experienced with this?
EDIT after some discussion:
In order to use the plugin i would need to get a fully configured instance of GFlyway from spring context. This becomes difficult since the bean only property is def config from where it will read all the required properties. The question is how to replicate this behavior within the resources.groovy ... how to provide the application config as a parameter to the bean.
As we have been discussing in the comments, the correct way to configure this as a bean would be:
// Resources.groovy
beans {
grailsApplication = ref('grailsApplication')
gFlyaway(gflyway2.GFlyway) {
config = grailsApplication.config
}
}
Configure the settings as usual within your Config.groovy per the documentation of the plugin.
That should get you closer, if not all the way there.

Configure spring security ldap-server attribute to use different url based on deployed environment

We are using spring security and have it working well. I am trying to figure out one thing that has not being obvious - how do I configure ldap-server attribute to use different url based on deployed environment?
This is what I have that is working:
<ldap-server url="ldap://testserver:port/o=blah" manager-dn="cn=bind,ou=Users,o=blah" manager-password="password"/>
<authentication-manager id="authenticationManager" alias="authenticationManager">
<ldap-authentication-provider
user-search-filter="(cn={0})"
user-search-base="ou=Users"
group-search-filter="(uniqueMember={0})"
group-search-base="ou=groups"
group-role-attribute="cn"
role-prefix="none">
</ldap-authentication-provider>
Now, how do I configure it to use a different url based on deployed environment?
thanks in advance,
Sharath
I've done that with Spring profiles:
In your spring.*.xml config file use this at the end of your file:
<beans profile="production">
...
</beans>
<beans profile="local">
...
</beans>
As VM Arguments the used profile must be provided:
-Dspring.profiles.active=production
Regards
You can use the url as variables and set them in a properties file.
To change the properties file should be easier. I know you can do that with Maven - with jar or war plugin depending on packaging, including generating two (or more) packages with one execution - but I suppose you can with Ant or other managers too.
Of course, you could use that solution to change the whole xml, but it's easier to do that with a properties file because that way, when changing the configuration, the markup will not be in the way, only variables and values.

Resources