1

Our system compose of 10 subsystems, and explore services by socket, http/xml, http/protobuff and ERP service, I am looking for a framework to manage the system integration, and research Mule3 for several days. I know mule service orchestration can make multiple call to different remote service in a flow, however i am wondering whether Mule can cancel previous services automatically, for example i want to call 4 remote services, so in mule3 i define a flow and call those 4 services in turn.

  1. call service#1
  2. call service#2
  3. call service#3
  4. call service#4

Now if service#4 failed, can Mule3 automatically call, for example

  1. call cancelService#1
  2. call cancelService#2
  3. call cancelService#3

to cancel those 3 successful services. For the same reason, if service#3 failed, I want to call cancelService#1 and cancelService#2. Can mule3 help to handle this?

Besides can Mule3 pass the response of previous service as argument to next service? for example pass the result of service#1 to service#2?

Thanks in advance.

4

1 回答 1

1

What you are looking for is called compensating pattern and it works well with transports not transactional by design (i.e. http)

Probably the best way to achieve this would be by incapsulating your compensating logic into a catch exception strategy and with a choice router, evaluate the exception and decide what services need to be compensated.

A more verbose option would be to store into the session what WS have already been invoked and use that property to chose what compensation needs to be done. I would not recommend this approach, unless you could not determine what WS have failed from the exception

于 2013-08-19T12:36:34.290 回答