为什么调用在 wso2 esb 中不起作用

why call is not working in wso2 esb

我对 wso2 esb 有疑问。 我写了一个代理,我调用了一个端点来对原始输入进行一些更改。但是通话前和通话后的日志是相同的(应该不同)。似乎呼叫在 all.when 时无法正常工作,我将响应发送到序列为空。任何人都可以说为什么会这样吗? (我已经在 soupUI 中测试了我的端点)

这是我的代理:

      <inSequence>
     <property name="transport.vfs.ReplyFileName" value="GET" scope="transport"/>
     <property name="OUT_ONLY" value="true" scope="default" type="STRING"/>
     <smooks config-key="smooks-csv1">
        <input type="text"/>
        <output type="xml"/>
     </smooks>
     <iterate continueParent="true"
              preservePayload="true"
              attachPath="//csv-set"
              expression="//csv-set/search"
              sequential="true">
        <target>
           <sequence>
              <xslt key="gov:/first.xsl"/>
              <xslt key="gov:/second.xsl"/>
              **<log level="full"/>
              <call blocking="true">
                 <endpoint>
                    <address uri="MyEndPiont"/>
                 </endpoint>
              </call>
              <log level="full"/>**
           </sequence>
        </target>
     </iterate>
     <respond/>
  </inSequence>
  <outSequence>
     <aggregate>
        <completeCondition>
           <messageCount min="0" max="100"/>
        </completeCondition>
        <onComplete expression="//Guest">
        </onComplete>
     </aggregate>
  </outSequence>

尝试blocking="false"。请注意,进行此更改不会使调用调解器异步。无论阻塞是真还是假,它都是同步的。阻塞只是一个实现细节。

The Call mediator is used to send messages out of the ESB to an endpoint. You can invoke services either in blocking or non-blocking manner.

When you invoke a service in non-blocking mode, the underlying worker thread returns without waiting for the response. In blocking mode, the underlying worker thread gets blocked and waits for the response after sending the request to the endpoint. Call mediator in blocking mode is very much similar to the Callout mediator.

In both blocking and non-blocking modes, Call mediator behaves in a synchronous manner. Hence, mediation pauses after the service invocation and resumes from the next mediator in the sequence when the response is received. Call mediator allows you to create your configuration independent from the underlying architecture.

引自https://docs.wso2.com/display/ESB500/Call+Mediator

试试这个。变更列表:

  • 删除了 respond 调解器。
  • 已将 call 替换为 send
  • 在输出序列中添加了 send

      <inSequence>
         <property name="transport.vfs.ReplyFileName" value="GET" scope="transport"/>
         <property name="OUT_ONLY" value="true" scope="default" type="STRING"/>
         <smooks config-key="smooks-csv1">
            <input type="text"/>
            <output type="xml"/>
         </smooks>
         <iterate continueParent="true"
                  preservePayload="true"
                  attachPath="//csv-set"
                  expression="//csv-set/search"
                  sequential="true">
            <target>
               <sequence>
                  <xslt key="gov:/first.xsl"/>
                  <xslt key="gov:/second.xsl"/>
                  <log level="full"/>
                  <send>
                     <endpoint>
                        <address uri="MyEndPiont"/>
                     </endpoint>
                  </send>
               </sequence>
            </target>
         </iterate>
      </inSequence>
      <outSequence>
         <aggregate>
            <completeCondition>
               <messageCount min="0" max="100"/>
            </completeCondition>
            <onComplete expression="//Guest">
            </onComplete>
         </aggregate>
         <send />
      </outSequence>