1

The documentation isn't very clear on the default function of a mediation sequence. I understand that it is possible to define in and out mediators to perform a set of mediators on messages that are incoming or outgoing.

However, what happens if I have neither of these defined? Does the sequence then accept and perform its mediators on ALL messages? If this is the case, is it therefore possible for a sequence to get stuck in an infinite loop if it sends out to a service and receives the response, causing it to send it out to that service again.

As an aside to this, is it recommended to always explicitly declare in/out mediators in every sequence?

Community
  • 1
  • 1
PLivesey
  • 196
  • 10

1 Answers1

2

Basically when you are using a sequences inside ESB , you will use as receiving sequence or as target sequence from a proxy.

1) Use as receiving sequence :
When you are using as receiving sequence you will be doing some kind of mediation on the response message to the ESB, and then continue with rest of the proxy meditations (not define any IN/OUT path, it just proceed with current direction of the message).There is no IN or OUT, so it will just continue with current direct where it came. See the sample below

http://docs.wso2.org/display/ESB470/Sample+156:+Service+Integration+with+specifying+the+receiving+sequence

2) Use as a proxy target sequence:
Here you can use your sequence as proxy target , so you can define IN path and OUT ,if you need to do some mediation separately inside sequence IN and OUT paths. But if you don't define OUT then it will proceed with the default ESB OUT path and response go back to client. There is no infinite loop as you assume.

http://docs.wso2.org/display/ESB470/Sample+381%3A+Class+Mediator+to+CBR+Binary+Messages

So it is your choice to put IN or OUT for sequence based on your requirement.

jayalalk
  • 2,382
  • 3
  • 17
  • 14