Hello, I found the following bug in your library.
https://github.com/neo4j/java-rest-binding/blob/1.8.RC1/src/main/java/org/neo4j/rest/graphdb/ExecutingRestRequest.java
private InputStream toInputStream(Object data) {
try {
if (data instanceof InputStream) return (InputStream) data;
PipedInputStream inputStream = new PipedInputStream(8 * 1024);
PipedOutputStream outputStream = new PipedOutputStream(inputStream);
StreamJsonHelper.writeJsonTo(data, outputStream);
return inputStream;
} catch (IOException e) {
throw new RuntimeException("Error writing "+data+" to stream",e);
}
}
Here you have buffer of 8kB: new PipedInputStream(8 * 1024);
But when I have big json request s your library hangs on: the following code:
Here the code block on this line: OBJECT_MAPPER.writeValue(generator, data);
The problem actually is that when you try to write big data (more than 8kB) to the outputStream , then the code hangs.
Please provide the fix for this issue, because your library is not able to process big messages.
Hello, I found the following bug in your library. https://github.com/neo4j/java-rest-binding/blob/1.8.RC1/src/main/java/org/neo4j/rest/graphdb/ExecutingRestRequest.java private InputStream toInputStream(Object data) { try { if (data instanceof InputStream) return (InputStream) data; PipedInputStream inputStream = new PipedInputStream(8 * 1024); PipedOutputStream outputStream = new PipedOutputStream(inputStream); StreamJsonHelper.writeJsonTo(data, outputStream); return inputStream; } catch (IOException e) { throw new RuntimeException("Error writing "+data+" to stream",e); } } Here you have buffer of 8kB: new PipedInputStream(8 * 1024); But when I have big json request s your library hangs on: the following code:
https://github.com/neo4j/java-rest-binding/blob/1.8.RC1/src/main/java/org/neo4j/rest/graphdb/util/StreamJsonHelper.java public static void writeJsonTo( Object data , OutputStream stream) { try { JsonGenerator generator = OBJECT_MAPPER.getJsonFactory() .createJsonGenerator(stream); OBJECT_MAPPER.writeValue(generator, data); stream.close(); } catch ( IOException e ) { throw new RuntimeException( e ); } }
Here the code block on this line: OBJECT_MAPPER.writeValue(generator, data); The problem actually is that when you try to write big data (more than 8kB) to the outputStream , then the code hangs.
Please provide the fix for this issue, because your library is not able to process big messages.
Regards,
Vasil Yordanov
vasil.yordanov@gmail.com