直到成功的组件轮询HTTP端点直到满足条件 [英] UntilSuccessful component to poll http endpoint till condition is met

查看:101
本文介绍了直到成功的组件轮询HTTP端点直到满足条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

轮询http端点,接收JSON响应,我希望一直轮询直到满足条件. 我已经尝试过<until-successful failureExpression="#[json:status != 'COMPLETED']" maxRetries="5" secondsBetweenRetries="10" synchronous="true">,但这给出了异常.

Polling http endpoint, receiving JSON response, I wish to keep polling till a condition is met. I have tried <until-successful failureExpression="#[json:status != 'COMPLETED']" maxRetries="5" secondsBetweenRetries="10" synchronous="true"> but this is giving exception.

请让我知道我的方案是否还有另一种方法

Please also let me know if there is another method for my scenario

推荐答案

将计算值分配给流量变量,并提供评估相应流量变量的条件.

assign the compute value to flow variable and provide condition evaluting the corresponding flow variable.

<until-successful failureExpression="#[flowVars['testRetryCondition'] != 'COMPLETED']" maxRetries="5" secondsBetweenRetries="10" synchronous="true"> <processor-chain doc:name="Processor Chain"> <http:........./> <set-variable variableName="testRetryCondition" value="#[json:status != 'COMPLETED']" doc:name="set-invocation-status"/> </processor-chain> </until-successful>

<until-successful failureExpression="#[flowVars['testRetryCondition'] != 'COMPLETED']" maxRetries="5" secondsBetweenRetries="10" synchronous="true"> <processor-chain doc:name="Processor Chain"> <http:........./> <set-variable variableName="testRetryCondition" value="#[json:status != 'COMPLETED']" doc:name="set-invocation-status"/> </processor-chain> </until-successful>

这篇关于直到成功的组件轮询HTTP端点直到满足条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆