To manage dynamic responses within the ESB when in its services throw either a valid response or a faulted one, we implemented the following scenario that may help you with similar cases.
First you have to take into account serveral important points:
-
An itinerary can define dynamically its response paths. Within an itinerary you can define if a service will respond or not. This isn’t quite a visible property, but it can be used to define if the itinerary service will respond to the client or to the following service.
This will be the scenario used in our use case.
-
An orchestration can handle one-way or two-way processes, seen as a process that can be design from the itineraries. You don’t have to explicitly place the two-way ports to handle this type of processes. In some cases, handling orchestrations with two-way ports doesn’t allow a simple management of the process since the process is always going to demand for a response when the Decision shapes are used. This means that the process will be required to return a response in all branches of the Decide Shape (“If”,“Else”, etc). Sometimes this becomes too complex to deal with.