I am using spring cloud function chaining in my project like below:
spring.cloud.function.definition = func_A|func_B|func_C|func_D
The above definition will pipe the result of func_A
to func_B
, and from func_B
to func_C
and so on...
Now if I have a business logic in func_B
that requires to stop the propagation to the following functions (fun_C
and func_D
), how to do it? I know throwing an exception in func_B
will stop the propagation, but is there any graceful way other than throwing exception?
Basically I need something like this in code level:
if(true){
proceed to `func_C` and `func_D`
}else{
stop and return (without throwing exception)
(or) route to a consumer function (where I will just log a message)
}
Thanks in advance:)