问题
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
回答1:
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>
来源:https://stackoverflow.com/questions/28640243/untilsuccessful-component-to-poll-http-endpoint-till-condition-is-met