问题
I have following configuration:
flow -> flow.handle(myHandler)
.filter(p -> {
log.warn("FILTER IS INVOKED");
return p != null;
}
In case if myHandler#handle
returns null - filter is not invoked.
How could I achieve passing null value to the filter ?
回答1:
I came up with workaround: create wrapper over handler return type:
class Wrapper {
Foo foo;
...
}
At this case I can do following:
flow -> flow.handle(myHandler)
.filter(p -> {
log.warn("FILTER IS INVOKED");
return p.getFoo() != null;
}
来源:https://stackoverflow.com/questions/59047347/how-to-avoid-flow-stopping-in-case-of-handler-returns-null