cancel
Showing results for 
Search instead for 
Did you mean: 

How to terminate from the processing sequence of an adapter module

Former Member
0 Kudos

Hi,
I am trying to develop a customised adapter module for a Sender JMS channel, which would check the delivery count of the message received against backout threshold value and move it to backout queue, if the condition is satisfied.

if(deliverycount >= threshold){
     /**Move the message to the backout queue..**/
}
In this case, threshold value is 3.

In the Sender channel, Modules have been configured as below:
1. Customised Adapter Module that has the above logic.
2. Message Transformation Bean
3. callSapAdapter

I have pushed a message which fails at MTB step. My expectation from this setup is, the channel should try to pick the message for 3 times and fail due to error in MTB. The fourth time, when the process enters the customised module, since the condition(deliverycount >= threshold) is satisfied, the message has to be moved to the backout queue and the processing should exit there itself. It should not go to the next module again which is MTB.

Please suggest how to stop processing sequence of adapter modules when a condition is met in the previous adapter module.

It would be very helpful for me if you can suggest a way out.

Thank you.

Regards,
Subbalaxmi

Accepted Solutions (0)

Answers (2)

Answers (2)

Shabarish_Nair
Active Contributor
0 Kudos

I have never been able to figure out an option to skip subsequent sequence of module entries based on some conditions or errors in the earlier module. Dont think such an option really exists. Hence the simple way to handle would be as suggested by Mike. Its a workaround that should help.

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>>Please suggest how to stop processing sequence of adapter modules when a condition is met in the previous adapter module.

easy way:

after this:

>>>>since the condition(deliverycount >= threshold) is satisfied, the message has to be moved to the backout queue

set any dynamic parameter in your adapter module with value - FAIL

in receveir determination do this condition - IF value different from FAIL process the message

(if not it will not process it)

and you're done as simple as that

Regards,

Michal Krawczyk

Former Member
0 Kudos

Hi Michal,

Thanks for the reply!

I have a query regarding the approach that you have suggested.
How would the processing of MTB(which is in the second step) in my JMS Sender communication channel get terminated, if I do this change in receiver determination ?

To explain my issue once again, I have three modules in the Processing Sequence section of the Sender communication channel as below:
Step 1. Customised Adapter Module that has the above logic.
Step 2. Message Transformation Bean
Step 3. callSapAdapter

If the condition(deliverycount >= threshold) is satisfied in the customised adapter module(first step), I dont want the process to move to the second step which is Message Transformation Bean.
The process should end at Step 1 itself.

Please help me by clarifying my doubt.

Regards,
Subbalaxmi

Shabarish_Nair
Active Contributor
0 Kudos

the only way to terminate a flow would be to throw a module exception. But with that you will not be able to proceed with any data flow. Thats why, the only work around is to handle the message processing in such a way that it will proceed further and based on some flag setting you do the check in RD.