2011-08-10 8 views
0

春の統合プロジェクトでは、メッセージを同期して送受信する発信ゲートウェイがあります。私はそのような操作にかかる時間をログに記録したいと思います。同期JMSコールに要したログ時間

<jms:outbound-gateway id="jmsOutGateway" 
        request-destination="outQueue" 
        request-channel="outboundJmsRequests" 
        reply-channel="jmsReplies"/> 

私は検索を試みましたが、AOPとPerformanceMonitorInterceptorを使用してメソッドをトレースする例しか見つかりませんでした。

+0

** [この質問は](http://stackoverflow.com/questions/5098254/distributed-jms-based-logging-falling-flat)** related? "db/jms/socket/etcにログインするのは同期して問題を抱えていて、たくさんのことを求めています。" –

+0

まあまあです。サービスにログを追加するつもりはありません。私は、テストクライアントが要求を送信してから応答を受け取るまでにかかる時間を記録しようとしています。テストクライアントは、Spring Integrationを使用して記述されます。 – Vasanth

答えて

0

あなたはこのようにそれを行うことができます。

<int-jms:outbound-gateway id="jmsOutGateway" 
        request-destination="outQueue" 
        request-channel="outboundJmsRequests" 
        reply-channel="jmsReplies"> 
    <int-jms:request-handler-advice-chain> 
     <bean class="org.springframework.aop.interceptor.PerformanceMonitorInterceptor"/> 
    </int-jms:request-handler-advice-chain> 
</int-jms:outbound-gateway> 

<request-handler-advice-chain>AbstractReplyProducingMessageHandler.handleRequestMessage方法に適用されると<int-jms:outbound-gateway>JmsOutboundGateway移入 - AbstractReplyProducingMessageHandlerの実装を。

関連する問題