简体   繁体   English

WSO2 ESB代理到WSO2是RemoteUserStoreManagerService

[英]WSO2 ESB Proxy to WSO2 IS RemoteUserStoreManagerService

I want to proxy RemoteUserStoreManagerService (exposed on WSO2 IS) over WSO2 ESB. 我想通过WSO2 ESB代理RemoteUserStoreManagerService(在WSO2 IS上公开)。

When I call getUserClaimValuesForClaims operation I get the response. 当我调用getUserClaimValuesForClaims操作时,我得到了响应。 I tested the WSO2 IS (connected to my Active Directory) for performance. 我测试了WSO2 IS(连接到我的Active Directory)以获得性能。 I sent requests in 100 threads (each thread with 250ms delay) and it gave me an average response of 250ms (which is ok for me). 我发送了100个线程的请求(每个线程延迟250ms),它给了我250ms的平均响应(这对我来说没问题)。

So I proxied the getUserClaimValuesForClaims operation using the Transformation proxy and it also worked. 所以我使用Transformation代理代理了getUserClaimValuesForClaims操作,它也有效。 But during the performace testing (with the same or smaller load) I have got following errors and not all the messages have returned (on average 1 of 100 messages). 但是在性能测试期间(负载相同或更小)我有以下错误而不是所有消息都返回(平均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

I thing that it says, it timeouts on backend; 它说的是,它在后端超时; but I get the response logged in faultSeuence. 但是我在faultSeuence中记录了响应。

I noticed that the problem is caused by the XSLT mediator in proxy implementation, because when I removed the xslt mediators the log is empty. 我注意到问题是由代理实现中的XSLT中介引起的,因为当我删除xslt中介时,日志为空。 I tried xquery and it was the same. 我试过xquery,它是一样的。 Even the log mediator in outSequence causes this issues. 甚至outSequence中的日志调解器也会导致此问题。

Here is my final Proxy. 这是我的最终代理。

<?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>

When I remove the log mediator, the WARN messages disapears from log and ALL response messages are returned to SoapUI. 当我删除日志中介时,WARN消息从日志中消失,所有响应消息都返回给SoapUI。

Could anybody tell me why it behaves this way? 有谁能告诉我它为什么会这样? Thank you very much. 非常感谢你。 David 大卫

RemoteUserStoreManagerService is an admin service. RemoteUserStoreManagerService是一个管理服务。 Therefore, you need to send Identity Server's user name/password in a basic authentication header or session cookie. 因此,您需要在基本身份验证标头或会话cookie中发送Identity Server的用户名/密码。 I can not see setting of authorization headers in your proxy configuration such as following 我无法在您的代理配置中看到授权标头的设置,例如以下内容

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

More details would be here . 更多细节将在这里 Also you need to create a message body to send to the "RemoteUserStoreManagerService" and read the response messages. 您还需要创建一个消息体以发送到“RemoteUserStoreManagerService”并读取响应消息。 These must be implemented using ESB configuration. 这些必须使用ESB配置实现。 However, you can write an custom ESB mediator to do this also. 但是,您也可以编写自定义ESB介体来执行此操作。 Sample java code to call this service can be found here . 可以在此处找到调用此服务的示例Java代码。 You can find the detail on writing custom mediator from here 您可以从此处找到有关编写自定义调解器的详细信息

We have figured out, that the problem is probably more general and doesn't relate only to WSO2 IS, because we have the same problem when similating the WSO2 IS service as SoapUI mock. 我们已经发现,问题可能更普遍,并且不仅仅与WSO2 IS有关,因为我们在将WSO2 IS服务与SoapUI mock相似时遇到了同样的问题。

The problem is probably in HTTP-passthru transport in axis configuration, because when we switched to HTTP-NIO the problem disapears and it is even faster. 问题可能出在轴配置中的HTTP-passthru传输中,因为当我们切换到HTTP-NIO时,问题就会消失,而且速度会更快。

There is a post about performance tunnig that helped us. 有一篇关于性能的文章帮助了我们。

Howevever, I would like to know what transport we should use in production or where the problem is. 但是,我想知道我们应该在生产中使用什么样的运输或者问题出在哪里。 Because now it seems that we cannot use HTTP-passthru transport for production environment. 因为现在看来我们不能将HTTP-passthru传输用于生产环境。

Is anyone experiencing this problem? 有人遇到过这个问题吗?

what are the versions of ESB and IS your working with..? 您正在使用的ESB和IS的版本是什么?

try to restart the ESB and call the Service again. 尝试重新启动ESB并再次调用服务。 Do remember call to Identity server is a secure call. 请记住,对Identity Server的呼叫是一种安全呼叫。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM