2014-01-06 182 views
0

我想通過WSO2 ESB代理RemoteUserStoreManagerService(在WSO2 IS上公開)。WSO2 ESB代理到WSO2 IS RemoteUserStoreManagerService

當我調用getUserClaimValuesForClaims操作時,我得到響應。我測試了WSO2 IS(連接到我的Active Directory)的性能。我用100個線程發送請求(每個線程延遲250ms),它給了我250ms的平均響應(這對我來說確實很好)。

所以我使用轉換代理代理了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消息在前看不見和ALL響應消息返回到了SoapUI。

有人能告訴我爲什麼這樣表現嗎? 非常感謝。 David

回答

0

您與ESB和IS的版本是什麼?

嘗試重新啓動ESB並再次調用服務。請記住呼叫身份服務器是一個安全的呼叫。

+0

嗨,Abhi,我使用的是wso2esb-4.8.0。 – David

+0

如果獨立呼叫(使用curl或soapUI),WSO2IS可以正常工作。然後嘗試在ESB中明確地關閉代理中的連接 Abhi

+0

謝謝您的提示Abhi。但是現在使用XSLT mediatiors時,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]錯誤 - 構建Passthrough流時發生RelayUtils錯誤 org.apache.axiom.om.OMException:javax.xml.stream.XMLStreamException:ParseError at [row,col]:[1, 1] 消息:內容不允許在序言中。 – David

1

RemoteUserStoreManagerService是一個管理服務。因此,您需要在基本身份驗證標頭或會話cookie中發送Identity Server的用戶名/密碼。我看不到授權頭設置在代理配置,如以下

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

更多細節將here。您還需要創建一個消息主體以發送到「RemoteUserStoreManagerService」並讀取響應消息。這些必須使用ESB配置來實現。但是,您也可以編寫自定義ESB中介來執行此操作。調用此服務的示例java代碼可以在here找到。你可以找到here

+0

謝謝你的回覆Asela。我是sendind身份驗證標題。爲了清楚起見,我在代理實現中省略了這一行我從SoapUI發送auth頭到代理,並傳播到WSO2 IS。它可以工作,但問題在重負載下出現。 – David

1

我們已經找到了在編寫自定義中介的細節,這個問題可能更普遍和WSO2 IS不僅涉及,因爲我們有同樣的問題時similating的WSO2 IS作爲服務SoapUI模擬。

問題可能出現在軸配置中的HTTP-passthru傳輸中,因爲當我們切換到HTTP-NIO時,問題消失並且速度更快。

有一篇關於performance tunnig的帖子幫助了我們。

Howevever,我想知道我們應該在生產中使用什麼運輸工具或問題在哪裏。因爲現在看來我們不能在生產環境中使用HTTP-passthru傳輸。

有沒有人遇到過這個問題?