2016-11-23 5 views
0

キューから残りのAPIにリクエストを送信していて、応答が戻っていない場合は、再度同じリクエストをキューに再度プッシュする必要があります。しかし、私は、私は以下のいずれかのよう、エラーを取得しています、キューにそれをプッシュしていたとき:処理ルートでタイムアウトエラーが発生しました

org.apache.camel.ExchangeTimedOutException:correlationIDが付き20000ミリ起因する応答メッセージ:OUTメッセージが内に受信されませんでした:Camel-ID-01HW828056-64538-1479908182896-32-4宛先で受信されません:temp-queue:// ID:01HW828056-64546-1479908191870-15:3:1

これは

<?xml version="1.0" encoding="UTF-8"?> 
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" 
    xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0" 
    xmlns:cxf="http://camel.apache.org/schema/blueprint/cxf" 
    xmlns:cxf-core="http://cxf.apache.org/blueprint/core" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="    http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd    http://camel.apache.org/schema/blueprint/cxf http://camel.apache.org/schema/blueprint/cxf/camel-cxf.xsd    http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd"> 

    <camelContext xmlns="http://camel.apache.org/schema/blueprint" trace="false"> 
    <route id="fromqueuecontext"> 
     <from uri="activemq:queue:request?asyncConsumer=true"/> 
      <unmarshal> 
      <jaxb partClass="partclassname" prettyPrint="true" contextPath="contextname"/> 
     </unmarshal> 
     <setProperty propertyName="capturequeuebean"> 
      <simple>${body}</simple> 
     </setProperty> 
     <log message="${property.capturequeuebean.orderNum}"/> 
     <log message="${property.capturequeuebean.transactionNumber}"></log> 
        <removeHeaders pattern="*" /> 
        <setHeader headerName="CamelHttpMethod" id="_setHeader1"> 
         <constant>PUT</constant> 
        </setHeader> 
        <setHeader headerName="Content-Type" id="_setHeader2"> 
         <constant>application/json</constant> 
        </setHeader> 

        <setBody> 
         <simple>${body.captureRequest}</simple> 
        </setBody> 

        <marshal> 
         <json library="Jackson"/> 
        </marshal> 
        <log message="sending body ${body}"/> 
        <convertBodyTo type="java.io.InputStream" id="_convertBodyTo1" />   
        <recipientList> 
         <simple><!--url to be sent --></simple> 
        </recipientList> 
        <log message="${header.CamelHttpResponseCode}" /> 
        <choice> 
         <when> 
          <simple>${header.CamelHttpResponseCode} != 201 and ${property.capturequeuebean.count} &gt; 0</simple> 

          <log message="inside 1st when"></log> 
          <setBody> 
           <simple>${property.capturequeuebean}</simple> 
          </setBody> 
          <bean ref="CaptureBusinessImpl" method="changecount"></bean> 
          <log message="${body.count}"></log> 
          <to uri="activemq:queue:request" /> 
         </when> 
         <otherwise> 
          <choice> 
           <when> 
            <simple>${header.CamelHttpResponseCode} == 201 </simple> 
            <log message="Sucess"></log> 
           </when> 
           <otherwise> 
            <choice> 
             <when> 
              <simple>${property.capturequeuebean.count} == 0</simple> 
              <log message="exception"></log> 
             </when> 
            </choice> 
           </otherwise> 
          </choice> 
         </otherwise> 
        </choice> 
    </route> 
    </camelContext> 

</blueprint> 
+1

それをしない理由を再度試みるREST呼び出し、についてです場合Camelエラーハンドラの[redelivery policy](http://camel.apache.org/dead-letter-channel.html)の使用? – Ralf

+0

この場合、私にどのように表示するのですか? –

+0

あなたの試行が失敗した場合、あなたは試しに質問をして戻ってみませんか? – Ralf

答えて

1

どこかJMSReplyToヘッダーが指定されており、ActiveMQの成分が応答を待って一時キューにコンシューマを作成している私のblueprint.xmlあります。応答は20,000ミリ秒で返されないため、activemqコンポーネントはあきらめてエラーをスローします。

自動のreplyTo取り扱いはActiveMQのエンドポイントに次のオプションを追加することで無効にすることができます。

?disableReplyTo=true&amp;preserveMessageQos=true 

を参照してくださいここではノート:Camel JMS Component

+0

これは実際には、この機能を有効にするのに役立ちました。いくつかのupvotesに値する。 –

関連する問題