英文:
Framework for multiple web service calling
问题
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.
我想问一下,是否有一些框架或设计(类似于SSIS)或者在处理数据时调用多个依赖的Web服务的最佳方法。
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.
我有一个Web应用程序,用户按下按钮后,应用程序会创建消息发送到MSMQ。有一个应用程序接收此消息并调用SOAP方法1,获取响应并处理数据,然后调用SOAP方法2等等。
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.
问题:
- 顺序可能会失败,因为远程SOAP服务器有时停止工作,管道应该能够从失败的地方重新开始。
英文:
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.
答案1
得分: 1
我相信最简单的解决方案是在数据库中创建一个表,该表将由您的服务更新。您的服务将存储哪些信息?关于当前执行状态的信息将存储在该表中。
例如,“SOAP方法1”已执行其任务。但是,“SOAP方法2”抛出了一个错误。因此,您的表将存储最后成功完成的任务:
表Service
:
1 SOAP_ONE “SOAP方法1”
2 SOAP_TWO “SOAP方法2”
表ServiceState
:
2 1 成功
插入了上述信息后,您就能够运行所需的服务。
更好的解决方案是应用一种称为Saga的微服务模式。此外,我认为这个主题也值得阅读:https://stackoverflow.com/questions/66918637/is-event-sourcing-an-enhanced-pattern-of-choreography-based-saga-pattern
英文:
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 https://stackoverflow.com/questions/66918637/is-event-sourcing-an-enhanced-pattern-of-choreography-based-saga-pattern
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论