Streaming JSON responses

Preparing the result of an HTTP call may lead to storing a lot of objects on the server side and thus triggering more garbage collection by the JVM than needed. To keep a lower memory footprint, there is the possibility of streaming the results.

We will get the list of friend's names of someone whose name is given as a parameter.

Create a new class with this code:

package learningneo4j;import org.codehaus.jackson.JsonEncoding;import org.codehaus.jackson.JsonGenerator;import;import;import;import;import;import;import;import ...

Get Learning Neo4j 3.x - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.