Put the setConfig() and setState() in two separated REST calls
@@ -110,12 +110,18 @@ public abstract class AbstractNiFiProcessorsRestClient implements NiFiProcessors
proc.setState(PROCESS_STATE.RUNNING.name());
return updateWithRetry(proc, 5, 300, TimeUnit.MILLISECONDS);
});
- sequence.add((proc) -> {
+
+ sequence.add(proc -> {
delay(2000);
- proc.setConfig(createConfig(originalProc.getConfig().getSchedulingStrategy(), originalProc.getConfig().getSchedulingPeriod()));
proc.setState(PROCESS_STATE.STOPPED.name());
return updateWithRetry(proc, 5, 300, TimeUnit.MILLISECONDS);
});
+
+ sequence.add(proc -> {
+ delay(2000);
+ proc.setConfig(createConfig(originalProc.getConfig().getSchedulingStrategy(), originalProc.getConfig().getSchedulingPeriod()));
+ return updateWithRetry(proc, 5, 300, TimeUnit.MILLISECONDS);
+ });
}
// Disable or start the processor again depending on its original state
