首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >直到-成功处理长期运行的查询中的对象列表不起作用

直到-成功处理长期运行的查询中的对象列表不起作用
EN

Stack Overflow用户
提问于 2017-04-12 04:09:08
回答 1查看 101关注 0票数 0

我想开发一个流程,可以让我对一个可能需要很长时间才能返回的外部系统进行查询。我可能需要查询列表中的多个值。我正在用一个成功的范围来解决这个问题.不幸的是,即使请求多次运行,失败的记录也不会被放入死信队列中。以下是我解决这个问题的尝试:

代码语言:javascript
复制
    <!-- Dead Letter Queue for exhausted attempts-->
    <vm:endpoint name="DLQ" path="DLQ_VM" doc:name="VM"/>

    <flow name="StartFlow" processingStrategy="synchronous">
        <!--Place a list of String errors to query for on this vm -->
         <vm:inbound-endpoint path="request-processing-queue" " 
                        exchange-pattern="one-way" doc:name="VM"/>
          <vm:outbound-endpoint path="reprocessing-queue" 
                        exchange-pattern="request-response" doc:name="VM"/>
          <logger level="INFO" message="Data returned is #[payload]"/>
          <catch-exception-strategy>
             <logger level="ERROR"  message="Failure During Processing"/>
           </catch-exception-strategy>
    </flow>



   <flow name="RetryingProcess">
       <vm:inbound-endpoint name="reprocessing-vm" exchange-
                                               pattern="request-response" 
                                path="reprocessing-queue" doc:name="VM"/>
       <foreach collection="#[payload]" doc:name="For Each">
            <vm:outbound-endpoint path="by-singles-vm"  exchange-
                            pattern="request-response"/>
       </foreach>
   </flow>


        <flow name="query-retry">
          <vm:inbound-endpoint path="by-singles-vm" exchange-
    pattern="request-response" doc:name="VM"/>
          <until-successful objectStore-ref="objectStore"
                      failureExpression="#[groovy:(exception &amp;&amp; 
                 exception in com.trion.CustomException)
                                         ||!(payload instanceof 
                  com.trion.QueryResult])]"
                      maxRetries="5"
                      millisBetweenRetries="300000"
                      deadLetterQueue-ref="DLQ_VM" doc:name="Until 
                                                      Successful">
                  <vm:outbound-endpoint path="try-again-vm" exchange-
            pattern="request-response" doc:name="VM"/>
          </until-successful>
        </flow>
    <flow name="GetQueryValue" >
           <vm:inbound-endpoint path="try-again-vm" exchange-
           pattern="request-response" doc:name="VM"/>
           <flow-ref name="QueryRequest" />
    </flow>

 <!-- This never happens, i.e. the results are not put here... after retying 
                         -->
   <flow name="AttemptsExceededProcessing">
    <inbound-endpoint ref="DLQ_VM" doc:name="Generic"/>
    <logger level="DEBUG" message="Entering Final Destination Queue with 
       payload is #[payload]"/>
   </flow>

    <!-- Here I have a query to the external system... >
    <flow name="QueryRequest">
      ...... Makes the long running query Here..
     //returns com.trion.QueryResult
      </flow>
  </mule>

请帮帮我!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-04-14 02:05:31

配置没有问题。我有一个非常小的millisSecondsBetweenRetry值集,以至于我没有看到日志消息,并且假设它不工作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43360127

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档