1

I would like to ask you, if there is some framework or designer (like SSIS) or best approach for calling of multiple dependent web services during processing of data.

I have a web application, where user press button and application creates message to MSMQ. There is an application that takes this message and calls the SOAP Method 1, takes response process data and call SOAP Method 2 etc.

Current state is horrible. It is a very deep method method and it is quite difficult to change this process. I have an idea to use Chain-of-responsibility design pattern, but this is a lot of programming. I think that someone must have solved a similar problem before.

Problems:

  • sequence can fail, because remote soap server stopped working sometime and pipeline should be able to start where failed.
Palle Due
  • 5,929
  • 4
  • 17
  • 32
Krivers
  • 1,986
  • 2
  • 22
  • 45
  • Seems like a not-very-well-planed-out microservice architecture to me. There are tools to help working with microservices, but I'm not an expert on the subject. – Zohar Peled Jun 12 '23 at 08:31
  • Yes, it badly programmed. I am trying to find a way how to do it better. Unfortunately, I don't know where else to get advice. Thank you for idea. – Krivers Jun 12 '23 at 08:36
  • 1
    Last time I've worked with microservice chains like this, we used ApacheMQ as our message broker. I don't know about MSMQ, but with AMQ there's the concept of message acknowledgment - the message will remain in the queue until acknowledged by the subscriber. This means that you can get the message from the queue, do whatever process you wish, and only once your process is completed send the acknowledgement message to the queue - so if your service falls while processing a message, that message will wait for it in the queue when recovered. This is something I would investigate in your case. – Zohar Peled Jun 12 '23 at 08:50

1 Answers1

1

I believe the most simple solution would be to create a table in database which will be updated by your services. What information will be stored by your services? The information about current execution status will be stored in that table.

For example, "SOAP method 1" executed its task. But "SOAP method 2" thrown an error. So your table will store the last successful completed task:

Table Service:

Id  Code            Name            

1   SOAP_ONE        "SOAP method 1" 

2   SOAP_TWO        "SOAP method 2"

Table ServiceState:

Id  Id_Service      State

2       1           Success

Having inserted the above information, you are capable to run the desired service.

The better solution would be to apply a microservice pattern called Saga. Moreover, I suppose this topic is also worth reading Is event sourcing an enhanced pattern of choreography-based SAGA pattern?

StepUp
  • 36,391
  • 15
  • 88
  • 148