如何使用 Java REST 绑定设置每个查询的读取超时? [英] How to set read timeout per query using Java REST binding?
问题描述
我正在使用 Neo4j 1.9.1 和内核 1.8,我想为几个查询指定读取超时......
I am using Neo4j 1.9.1 and Kernel 1.8, I want to specify read time out for few queries ...
提前致谢.
推荐答案
我不确定这是否直接可行.您需要通过服务器中的配置启用防护并设置 http 标头 max-execution-time
,如 Mark 在 http://www.markhneedham.com/blog/2013/10/17/neo4j-setting-query-timeout/一>.
I'm not sure if that is directly possible. You need to enable guards by config in your server and set a http header max-execution-time
as described in Mark's blog post at http://www.markhneedham.com/blog/2013/10/17/neo4j-setting-query-timeout/.
Java Rest 绑定需要调整,参见 https://github.com/neo4j-contrib/java-rest-binding/blob/master/src/main/java/org/neo4j/rest/graphdb/ExecutingRestRequest.java#L102 了解如何显式设置 http 标头.对于 max-execution-time
也可以做同样的事情.
Java Rest bindings need to be tweaked, see https://github.com/neo4j-contrib/java-rest-binding/blob/master/src/main/java/org/neo4j/rest/graphdb/ExecutingRestRequest.java#L102 for how to explicitly set an http header. The same thing can be done for max-execution-time
.
这篇关于如何使用 Java REST 绑定设置每个查询的读取超时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!