WSO2在一个序列中有许多服务调用的良好实践
我正在按计划进行工作,需要执行以下任务:WSO2在一个序列中有许多服务调用的良好实践,wso2,soa,wso2esb,synapse,Wso2,Soa,Wso2esb,Synapse,我正在按计划进行工作,需要执行以下任务: call GetNew data service getting possible new xml data if xml exists with the xml data, get the ID and save it into a property call UpdateStatus data service with the parameters ID and PROCESSING call the ProcessOrder
call GetNew data service getting possible new xml data
if xml exists
with the xml data, get the ID and save it into a property
call UpdateStatus data service with the parameters ID and PROCESSING
call the ProcessOrder service passing the xml data
if the return is success
call the external SetStatus service with SUCCESS
otherwise
call the external SetStatus service with ERROR
call UpdateStatus data service again with the parameters ID and PROCESSING
otherwise
do nothing
为此,我构建了以下序列:
payload -- to build a GetNew request
callout -- to call the GetNew data service
property -- to save the ID from the possible new message
filter -- verify if the ID property exists
then
clone
payload -- to build a UpdateStatus PROCESSING request
callout -- call the UpdateStatus
xslt -- transform the XML from GetNew to the ProcessOrder
in
send -- to the ProcessOrder endpoint
out
property -- save the status of the ProcessOrder response
payload -- to build the SetStatus request
callout -- call the external SetStatus service with the status
payload -- to build a UpdateStatus PROCESSED request
callout -- call the UpdateStatus
else
drop
我想知道这是否是一个好的实践,或者我是否应该将其分成许多序列,或者用send替换调用,以及如何使用这种方法处理SoapFaults的最佳方法
提前感谢。在设计决策中打破许多顺序。一般来说,序列更像一个类。如果一个特定的序列执行一个特定的任务,那么它将是内聚的,并且在其他场景中也是高度可重用的。因此,最好根据通过序列执行的逻辑任务进行中断 使用callout或send mediator取决于您试图实现的用例。发送中介与调用的不同之处在于使调用异步。因此callout mediator会进行阻塞调用,但如果您需要服务的响应来继续执行序列,这将非常有用。 您可以在以下链接上获得有关这些中介的更多详细信息 对于代理服务和序列,您可以定义故障序列来处理故障场景。有关错误处理的更多信息,请参见