在 WSO2 API 管理器的自定义中介流中无法通过呼叫中介 [英] Can't get past Call Mediator in custom mediation flow in WSO2 API Manager

查看:13
本文介绍了在 WSO2 API 管理器的自定义中介流中无法通过呼叫中介的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 WSO2 AM 1.10 中创建了自定义中介流,以实现 API 链接.作为第一步,我创建了这个流程作为测试,它调用 REST 服务以生成令牌并将响应返回给客户端.

Created custom mediation flow in WSO2 AM 1.10 in order to achieve API chaining. As a first step i created this flow, as a test, which calls a REST service in order to generate a token and returns the response to the client.

<?xml version="1.0" encoding="UTF-8"?>
<sequence name="ppayload" trace="enable" xmlns="http://ws.apache.org/ns/synapse">
  <property action="remove" name="REST_URL_POSTFIX" scope="axis2"/>
  <property name="uri.var.x" scope="default" type="STRING" value="5"/>
  <property name="uri.var.y" scope="default" type="STRING" value="5"/>
  <log level="custom" separator=",">
    <property expression="get-property('uri.var.y')" name="y"/>
    <property expression="get-property('uri.var.x')" name="x"/>
  </log>
  <call>
    <endpoint>
      <http method="get" trace="enable" uri-template="https://192.88.65.18:9443/am/sample/calculator/v1/api/add?x={uri.var.x}&amp;y={uri.var.y}"/>
    </endpoint>
  </call>
  <respond/>
</sequence>

但是,超时后,客户端会收到服务器没有响应".但在日志中,我看到 API 网关收到了正确的响应,只是没有将其转发给客户端.

However, after timeout the client receives a "no response from server". But in the logs i see the API Gateway receives the correct response it just doesn't forward it to the client.

另外,我尝试在调用调解器之后添加日志调解器以记录响应,但在执行序列中的调用调解器之后没有任何内容.

Plus i tried adding log mediator after the call mediator to log the response but nothing that comes after the call mediator in the sequence is executed.

[2016-07-20 12:13:42,195] DEBUG - wire >> "GET /c/1.0.0 HTTP/1.1[
][
]"
[2016-07-20 12:13:42,195] DEBUG - wire >> "Authorization: Bearer c5836f1cb43350b803cb39c706c1c7ce[
][
]"
[2016-07-20 12:13:42,195] DEBUG - wire >> "Accept: application/json[
][
]"
[2016-07-20 12:13:42,195] DEBUG - wire >> "Referer: https://192.88.65.18:9443/store/apis/info?name=C&version=1.0.0&provider=admin[
][
]"
[2016-07-20 12:13:42,195] DEBUG - wire >> "Accept-Language: fr-FR[
][
]"
[2016-07-20 12:13:42,195] DEBUG - wire >> "Accept-Encoding: gzip, deflate[
][
]"
[2016-07-20 12:13:42,195] DEBUG - wire >> "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko[
][
]"
[2016-07-20 12:13:42,195] DEBUG - wire >> "Host: 192.88.65.18:8243[
][
]"
[2016-07-20 12:13:42,195] DEBUG - wire >> "Connection: Keep-Alive[
][
]"
[2016-07-20 12:13:42,195] DEBUG - wire >> "Cookie: JSESSIONID=4308DDC996DAAE6B65F183E65931DE14; requestedURI="../../carbon/mediation-tracer/index.jsp?region=region4&item=mediation_tracer_menu"; region1_configure_menu=none; region5_tools_menu=none; i18next=fr-FR; selectedTab=view; current-breadcrumb=monitor_menu%2Cmediation_tracer_menu%23; MSG14682483937790.7211503494363702=true; MSG14683265253540.54003207439675=true; MSG14683266178700.10747833380176508=true; MSG14688271624980.9002550537769108=true; MSG14688272096380.869345530960711=true; MSG14688276939770.25641217913473224=true; MSG14688285230820.7837411368495956=true; MSG14688303649840.057579581328428775=true; MSG14688354130800.8363238567475415=true; MSG14688444175760.4841881764888184=true; region4_monitor_menu=visible; region3_registry_menu=visible; csrftoken=rg0quh61dsudlg02rvus1qs491; menuPanel=visible; menuPanelType=monitor[
][
]"
[2016-07-20 12:13:42,195] DEBUG - wire >> "[
][
]"
[2016-07-20 12:13:42,200]  INFO - LogMediator y = 5,x = 5
[2016-07-20 12:13:42,204] DEBUG - wire << "GET /am/sample/calculator/v1/api/add?x=5&y=5 HTTP/1.1[
][
]"
[2016-07-20 12:13:42,204] DEBUG - wire << "Cookie: JSESSIONID=4308DDC996DAAE6B65F183E65931DE14; requestedURI="../../carbon/mediation-tracer/index.jsp?region=region4&item=mediation_tracer_menu"; region1_configure_menu=none; region5_tools_menu=none; i18next=fr-FR; selectedTab=view; current-breadcrumb=monitor_menu%2Cmediation_tracer_menu%23; MSG14682483937790.7211503494363702=true; MSG14683265253540.54003207439675=true; MSG14683266178700.10747833380176508=true; MSG14688271624980.9002550537769108=true; MSG14688272096380.869345530960711=true; MSG14688276939770.25641217913473224=true; MSG14688285230820.7837411368495956=true; MSG14688303649840.057579581328428775=true; MSG14688354130800.8363238567475415=true; MSG14688444175760.4841881764888184=true; region4_monitor_menu=visible; region3_registry_menu=visible; csrftoken=rg0quh61dsudlg02rvus1qs491; menuPanel=visible; menuPanelType=monitor[
][
]"
[2016-07-20 12:13:42,204] DEBUG - wire << "Accept: application/json[
][
]"
[2016-07-20 12:13:42,204] DEBUG - wire << "Referer: https://192.88.65.18:9443/store/apis/info?name=C&version=1.0.0&provider=admin[
][
]"
[2016-07-20 12:13:42,204] DEBUG - wire << "Accept-Encoding: gzip, deflate[
][
]"
[2016-07-20 12:13:42,204] DEBUG - wire << "Accept-Language: fr-FR[
][
]"
[2016-07-20 12:13:42,204] DEBUG - wire << "Host: 192.88.65.18:9443[
][
]"
[2016-07-20 12:13:42,204] DEBUG - wire << "Connection: Keep-Alive[
][
]"
[2016-07-20 12:13:42,204] DEBUG - wire << "User-Agent: Synapse-PT-HttpComponents-NIO[
][
]"
[2016-07-20 12:13:42,204] DEBUG - wire << "[
][
]"
[2016-07-20 12:13:42,205] DEBUG - wire >> "HTTP/1.1 200 OK[
][
]"
[2016-07-20 12:13:42,206] DEBUG - wire >> "Date: Wed, 20 Jul 2016 10:13:42 GMT[
][
]"
[2016-07-20 12:13:42,206] DEBUG - wire >> "Content-Type: application/json[
][
]"
[2016-07-20 12:13:42,206] DEBUG - wire >> "Content-Length: 18[
][
]"
[2016-07-20 12:13:42,206] DEBUG - wire >> "Server: WSO2 Carbon Server[
][
]"
[2016-07-20 12:13:42,206] DEBUG - wire >> "[
][
]"
[2016-07-20 12:13:42,206] DEBUG - wire >> "{"answer": "10.0"}"
[2016-07-20 12:13:42,208] ERROR - ContinuationStackManager Resource : null not found
[2016-07-20 12:13:42,214] ERROR - SynapseCallbackReceiver Synapse encountered an exception, No error handlers found - [Message Dropped]
Resource : null not found
[2016-07-20 12:13:54,738]  INFO - CarbonAuthenticationUtil 'admin@carbon.super [-1234]' logged in at [2016-07-20 12:13:54,738+0200]
[2016-07-20 12:14:24,850]  WARN - SourceHandler Connection time out after request is read: http-incoming-43
[2016-07-20 12:14:42,259]  WARN - SourceHandler Connection time out after request is read: http-incoming-44

谁能指出我的配置有什么问题.谢谢.

Can anyone please indicate what is wrong with my configuration. Thank you.

推荐答案

看起来像一个已经修复的错误(参见 这里),带有 this 提交.也许您可以手动修补它,因为它是一个小修复,直到您获得下一个版本.1.10 版本的来源是这里.

Looks like an already fixed bug (See here), with this commit. May be you can patch it manually since it is a small fix until you get the next release. Source for 1.10 release is here.

这篇关于在 WSO2 API 管理器的自定义中介流中无法通过呼叫中介的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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