java - How to set read timeout with RestCypherEngine Query -
i've been trying figure out how prevent read socket timeouts when making queries using restcypherengine in java application. here class ...
@service public class userserviceimpl implements userservice { @autowired threadpooltaskexecutor taskexecutor; @autowired restapifacade gd; @autowired restcypherqueryengine engine; @override public void addactivityobjecttograph(list<activity> activities) { taskexecutor.execute(new processactivity(activities)); } //runnable process activities come in.. class processactivity implements runnable { private list<activity> activities; public processactivity() { } public processactivity(list<activity> activities) { this.activities = activities; } @override public void run() { map<string, object> params = new hashmap<>(); log.info("processing activity collection of size: " + activities.size()); (activity activity : activities) { map<string, object> props = new hashmap<>(); props.put("activityid", activity.getactivityid()); props.put("objecttype", activity.gettargetobjecttype()); props.put("objectid", activity.gettargetobjectid()); props.put("containertype", activity.getcontainerobjecttype()); props.put("containerid", activity.getcontainerobjectid()); props.put("activitytype", activity.gettype()); props.put("userid", activity.getuserid()); props.put("creationdate", activity.getcreationdate()); seek (transaction tx = gd.begintx()) { params.put("props", props); params.put("userid", activity.getuserid()); engine.query("match (p:person{userid:{userid}}) create unique (p)-[:created]->(a:activity{props})", params); params.clear(); tx.success(); } grab (restresultexception rre) { log.info(rre.getlocalizedmessage()); } grab (cypherexecutionexception cee) { log.info(cee.getlocalizedmessage()); }catch(exception e) { log.info(e.getlocalizedmessage()); } } } } } when application starts, fine results query exceution after while, start getting bunch of exception messages these
2014-06-20 09:33:24.070 info 12902 [taskexecutor-15] --- c.y.n.services.impl.userserviceimpl : java.net.sockettimeoutexception: read timed out 2014-06-20 09:33:24.446 info 12902 [taskexecutor-94] --- c.y.n.services.impl.userserviceimpl : java.net.sockettimeoutexception: read timed out 2014-06-20 09:33:24.501 info 12902 [taskexecutor-46] --- c.y.n.services.impl.userserviceimpl : java.net.sockettimeoutexception: connect timed out 2014-06-20 09:33:24.512 info 12902 [taskexecutor-47] --- c.y.n.services.impl.userserviceimpl : java.net.sockettimeoutexception: connect timed out i read in several articles solved setting org.neo4j.rest.read_timeout property 100 seconds have no thought how should go setting value. added setting application.properties file (i running spring boot gradle application way) seems have no effect.
i running neo4j community server (v2.1.2) on centos 6 server 30gb ram think should sufficient production grade systems. need rid of these errors?
thanks.
java neo4j cypher
No comments:
Post a Comment