2015-11-01 62 views
0

Im使用spring Http集成和amqp for rabbit mq,它的失敗 loadtesting併發用戶... 在jmeter和rabbitmq消息計數中顯示的消息計數不是 matching..its爲30至用戶Spring Integration Http + amqp rabbitmq- 100個用戶的併發問題

<int-http:inbound-gateway id="logIngesterGatewayBulk" 
     supported-methods="POST" request-channel="logIngesterRestEndpointBulk" 
     path="/rest/log/bulk" error-channel="errorChannel" reply-timeout="10" 
     request-payload-type="java.lang.String"> 
    </int-http:inbound-gateway> 

<int:filter input-channel="logIngesterRestEndpointBulk" 
     throw-exception-on-rejection="true" method="validate" ref="payloadValidation" 
     output-channel="filterChannelbulk"> 
    </int:filter> 

    <int:chain input-channel="filterChannelbulk" output-channel="messageOutputChannel" id="chaining" > 
     <int:splitter id="splitter" ref="payloadSplitter" method="splitPayLoad" > 

     </int:splitter> 
     <int:transformer id="logMessageTransformerbulk" ref="logMessageHeaderTransformer" 
      method="transform"> 
     </int:transformer> 
    </int:chain> 
    <int:service-activator input-channel="errorChannel" 
     ref="responseHandler" method="handleFailedPayLoad"> 
    </int:service-activator> 


<int-amqp:outbound-channel-adapter 
     id="amqpAdapter" channel="messageOutputChannel" amqp-template="amqpTemplate" 
     exchange-name="dhp_exchange" routing-key-expression="headers['routingKey']"> 

回答

0

做工精細你需要找出爲什麼有不匹配。調試101,恐怕。

從確定哪些消息丟失開始,以及爲什麼 - DEBUG日誌記錄會有所幫助,但通過跟蹤每條消息來記錄日誌可能非常繁瑣,但信息絕對存在。確保在日誌配置中包含線程名稱;調試多線程應用程序時這是強制性的。

您需要確保您的代碼是線程安全的 - payloadValidation,payloadSplitter,logMessageHeaderTransformer beans等 - 無共享狀態(字段)或同步無誤。

+0

嘿,它的使用解決了<任務:執行ID = 「bulkChannelExecutor」 \t \t \t /> – Navaneeth

+0

它現在能收到100名併發用戶的請求...謝謝 – Navaneeth