【问题标题】:WSO2 ESB Proxy to WSO2 IS RemoteUserStoreManagerServiceWSO2 ESB 代理到 WSO2 是 RemoteUserStoreManagerService
【发布时间】:2017-11-24 17:33:04
【问题描述】:

我想通过 WSO2 ESB 代理 RemoteUserStoreManagerService(在 WSO2 IS 上公开)。

当我调用 getUserClaimValuesForClaims 操作时,我得到了响应。我测试了 WSO2 IS(连接到我的 Active Directory)的性能。我在 100 个线程中发送请求(每个线程有 250 毫秒的延迟),它给了我 250 毫秒的平均响应(这对我来说没问题)。

所以我使用 Transformation 代理代理了 getUserClaimValuesForClaims 操作,它也有效。但是在性能测试期间(负载相同或更小),我遇到了以下错误,并且并非所有消息都已返回(平均 100 条消息中的 1 条)。

[2014-01-06 19:28:21,047]  INFO - LogMediator To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:d2b85c03-beaf-409b-bf39-2e8143bd9e0b, Direction: response
[2014-01-06 19:28:38,441] ERROR - SourceHandler I/O error: An established connection was aborted by the software in your host machine
  java.io.IOException: An established connection was aborted by the software in your host machine
    at sun.nio.ch.SocketDispatcher.read0(Native Method)
    at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:25)
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:202)
    at sun.nio.ch.IOUtil.read(IOUtil.java:175)
    at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:243)
    at org.apache.http.nio.reactor.ssl.SSLIOSession.receiveEncryptedData(SSLIOSession.java:348)
    at org.apache.http.nio.reactor.ssl.SSLIOSession.isAppInputReady(SSLIOSession.java:376)
    at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady
 [2014-01-06 19:29:14,051]  WARN - TargetHandler http-outgoing-66: Connection time out while in state: REQUEST_DONE
 [2014-01-06 19:29:14,061]  WARN - EndpointContext Endpoint : AnonymousEndpoint will be marked SUSPENDED as it failed
 [2014-01-06 19:29:15,041]  WARN - EndpointContext Suspending endpoint : AnonymousEndpoint - last suspend duration was : 30000ms and current suspend duration is : 30000ms - Next retry after : Mon
 [2014-01-06 19:29:14,451]  WARN - SourceHandler Connection time out after request is read: http-incoming-57

我说的是,它在后端超时;但我在 faultSeuence 中记录了响应。

我注意到问题是由代理实现中的 XSLT 中介引起的,因为当我删除 xslt 中介时,日志是空的。我尝试了 xquery,它是一样的。甚至 outSequence 中的日志中介也会导致此问题。

这是我的最终代理。

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="GetUserProxy" transports="https http" startOnLoad="true" trace="disable">
<target>
    <endpoint>
        <address uri="https://localhost:9443/services/RemoteUserStoreManagerService.RemoteUserStoreManagerServiceHttpsSoap12Endpoint/"/>
    </endpoint>
    <inSequence/>
    <outSequence>
        <log/>
        <send/>
    </outSequence>
    <faultSequence/>
</target>
</proxy>

当我删除日志中介时,WARN 消息会从日志中消失,所有响应消息都会返回给 SoapUI。

谁能告诉我为什么它会这样? 非常感谢。 大卫

【问题讨论】:

    标签: wso2 wso2esb wso2is


    【解决方案1】:

    RemoteUserStoreManagerService 是一项管理服务。因此,您需要在基本身份验证标头或会话 cookie 中发送 Identity Server 的用户名/密码。我在您的代理配置中看不到授权标头的设置,例如以下

    <property expression="fn:concat('Basic ', base64Encode('username:password'))" name="Authorization" scope="transport"></property> 
    

    更多详情请联系here。您还需要创建一个消息正文以发送到“RemoteUserStoreManagerService”并阅读响应消息。这些必须使用 ESB 配置来实现。但是,您也可以编写自定义 ESB 中介来执行此操作。可以在here 找到调用此服务的示例 java 代码。您可以从here找到有关编写自定义中介的详细信息

    【讨论】:

    • 谢谢你的回复阿塞拉。我正在发送身份验证标头。为了清楚起见,我在代理实现中省略了这一行。我将 auth 标头从 SoapUI 发送到代理,并传播到 WSO2 IS。它有效,但问题出现在重负载。
    【解决方案2】:

    我们已经发现,这个问题可能更普遍,并且不仅仅与 WSO2 IS 有关,因为我们在将 WSO2 IS 服务模拟为 SoapUI 模拟时遇到了同样的问题。

    问题可能出在轴配置中的 HTTP-passthru 传输中,因为当我们切换到 HTTP-NIO 时,问题就消失了,而且速度更快。

    有一篇关于performance tunnig 的帖子对我们有帮助。

    但是,我想知道我们应该在生产中使用哪种传输方式或问题出在哪里。因为现在看来我们不能在生产环境中使用 HTTP-passthru 传输。

    有人遇到这个问题吗?

    【讨论】:

      【解决方案3】:

      ESB 的版本是什么,您使用的是什么版本..?

      尝试重新启动 ESB 并再次调用服务。请记住对身份服务器的调用是安全调用。

      【讨论】:

      • 嗨,Abhi,我正在使用 wso2esb-4.8.0。
      • 如果 WSO2IS 在您独立调用时运行良好(使用 curl 或 soapUI)。然后尝试在 ESB 中的代理中显式关闭连接
      • 感谢您的提示 Abhi。但是现在使用 XSLT 中介时,1000 条消息中有 2 条没有到达。 [2014-01-07 18:06:55,422] 错误 - NativeWorkerPool 未捕获异常 org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[8,21] 消息:文档中根元素之后的标记必须格式正确。 [2014-01-07 18:06:55,578] 错误 - 构建直通流 org.apache.axiom.om.OMException 时出现 RelayUtils 错误:javax.xml.stream.XMLStreamException:ParseError 在 [row,col]:[1,1 ] 消息:prolog 中不允许有内容。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-06-15
      • 1970-01-01
      • 1970-01-01
      • 2012-08-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多