面对一个非常奇怪的问题。我有一个角度应用程序休息调用spring boot api服务器,该服务器使用Elastic Search REST客户端调用弹性服务器来获取响应。
api服务器充当网关并附加auth并将请求传递给右索引而不打开请求主体。
当我从本地机器测试时,一切正常。当我部署到我的开发服务器。在10个中,2-3个请求总是失败,
org.elasticsearch.client.ResponseException: GET http://172.16.28.103:9200/customer-9/INSTANCE_DISTRIBUTION_RESPONSE/_search: HTTP/1.1 400 Bad Request
nova_1 | {"error":{"root_cause":[{"type":"parse_exception","reason":"Failed to derive xcontent"}],"type":"parse_exception","reason":"Failed to derive xcontent"},"status":400}
或
{"error":{"root_cause":[{"type":"parsing_exception","reason":"[value_count] failed to parse field [field]","line":1,"col":287}],"type":"parsing_exception","reason":"[value_count] failed to parse field [field]","line":1,"col":287,"caused_by":{"type":"json_e_o_f_exception","reason":"Unexpected end-of-input in VALUE_STRING\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@68bca79f; line: 1, column: 617]"}},"status":400}
还有其他人面对吗?使用弹性搜索5.2.0
示例请求
{"size":0,"query":{"bool":{"must":[{"match":{"CYCLE_INSTANCE_ID":45}}]}},"aggs":{"distribution":{"terms":{"field":"CYCLE_INSTANCE_DISTRIBUTION_DISTRIBUTION"},"aggs":{"weight":{"terms":{"field":"CYCLE_INSTANCE_DISTRIBUTION_WEIGHTAGE"}}}}}}
另外,我在中间使用基于节点的rocky-proxy。我在Spring启动控制器上收到的请求就像 -
一样搞砸了ze":0,"query":{"bool":{"must":[{"match":{"CYCLE_INSTANCE_ID":45}}]}},"aggs":{"distribution":{"terms":{"field":"CYCLE_INSTANCE_DISTRIBUTION_DISTRIBUTION"},"aggs":{"weight":{"terms":{"field":"CYCLE_INSTAN
所以可以肯定的是,b / w节点代理和spring引导正在搞乱请求。