问题
Does camel have support for streaming splitting of large JSON data? I know that the support is there for xml. I tried splitting large json files with jsonpathexpression. It worked fine with small files but gives OOM exception with large files.
JsonPathExpression jsonPathExpression = new JsonPathExpression("$.");
from("stream:hxxp://dummy:5984/test/a123/p.txt")
.split(jsonPathExpression).streaming().parallelProcessing()
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
String s = exchange.getIn().getBody(String.class);
}
})});
来源:https://stackoverflow.com/questions/23408904/camel-streaming-splitter-for-large-json-files