How to stop channel processing on encountering an error in input message ? #4931
Unanswered
sanjay86alld
asked this question in
Q&A
Replies: 2 comments 3 replies
-
Are you batching in any way? |
Beta Was this translation helpful? Give feedback.
3 replies
-
Try the following:
I am not 100% sure if the batch splitter & channel are working synchronously. So it might not work like intended if they are not. In this (quite unlikely) case, you would have to check the existence of 'stopProcessing' in the source filter of your channel. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello All ,
In my channel destination transformer I have written script to convert input messages to output.
I am writing the code in try catch block. On encountering an error in input message I am trying to stop the channel from further processing via this statement in catch block -
ChannelUtil.stopChannel(channelId);
My question is - This is not working as expected . I see the channel status changing from "Started" to "Stopping" to "Stopped" status but only after a while. By that time it has processed few more messages after the message which was having error.
I want to stop the processing as soon as the we get a message which has error .
I tried this as well - ChannelUtil.haltChannel(channelId); ( using ) - This is also giving same behavior .
How can I stop the channel from further processing any more messages ?
Any other approach which I should take here .
Beta Was this translation helpful? Give feedback.
All reactions