0
votes

Can anyone provide a clear explanation of when to use nullChannel() vs. when to use get() when configuring a SI Flow with the DSL ?

1

1 Answers

2
votes

The nullChannel() is a shortcut of the .channel(“nullChannel”).get(). But it still has that logical purpose to give a clue for target developer that this is the end of the flow and we can’t continue processing after nullChannel since this channel cannot be subscribed for consuming messages sent to it.

If your confuse is why would one specify a nullChannel if there probably would be enough just have that get(), then the answer is: it is possible and a valid use-case when you rely on the replyChannel header to produce the result from your endpoint. But if you fully want to void that result, the nullChannel must be configured explicitly.