Commit fffe2718 authored by Phillip Grenier's avatar Phillip Grenier
Browse files

Read path from configured property

parent 1346944d
......@@ -69,7 +69,7 @@ public class JsonProcessor extends AbstractProcessor {
}
@Override
public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException {
public void onTrigger(final ProcessContext context, final ProcessSession session) throws ProcessException {
final ProcessorLog log = this.getLogger();
final AtomicReference<String> value = new AtomicReference<>();
......@@ -80,7 +80,7 @@ public class JsonProcessor extends AbstractProcessor {
public void process(InputStream in) throws IOException {
try{
String json = IOUtils.toString(in);
String result = JsonPath.read(json, "$.hello");
String result = JsonPath.read(json, context.getProperty(JSON_PATH).getValue());
value.set(result);
}catch(Exception ex){
ex.printStackTrace();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment