You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by mario_horny <ma...@dzbank.de> on 2009/01/20 13:55:19 UTC

timeout exception when pushing a message to a JMS Queue

Hi guys,

I've got the following scenario. I want to receive a HTTP Message, put the
received message into a queue, wait for response and give the response back
as HTTP response.

My spring.xml looks like that:

<!-- define INBOUND interface of the router  -->
<cxf:cxfEndpoint id="RouterIn" address="..."  serviceClass="..." >
</cxf:cxfEndpoint>

<!-- define OUTBOUND interface of the router -->
<cxf:cxfEndpoint id="RouterOut" 
wsdlURL="mywsdl.wsdl"
endpointName="myPort"
serviceName="myService"
serviceClass="..."
</cxf:cxfEndpoint>

<!-- Define the route to the VR Infoforum service -->    		
<camelContext id="camel"
xmlns="http://activemq.apache.org/camel/schema/spring">
  <route errorHandlerRef="myDeadLetterErrorHandler">
     <from uri="cxf:bean:RouterIn" />
     <to uri="cxf:bean:RouterOut" /> 
   </route>
</camelContext> 

<!-- error handling  -->
<bean id="myDeadLetterErrorHandler"
class="org.apache.camel.builder.DeadLetterChannelBuilder">
   <!-- define dead letter endpoint for messages that cannot be routed -->
   <!--  property name="defaultDeadLetterEndpointUri" value"TODO"/ -- >
   <!-- reference the redelivery policy to use -->
   <property name="redeliveryPolicy" ref="myRedeliveryPolicyConfig"/>
</bean>

<!-- here we set the redelivery settings -->
<bean id="myRedeliveryPolicyConfig"
class="org.apache.camel.processor.RedeliveryPolicy">
   <!-- try redelivery at most 0 times, after that the exchange is dead  -->
      <property name="maximumRedeliveries" value="0"/>
</bean>   

In the wsdl File, the JMS definitions are made whose values are resolved
using a JNDI file:

<!-- Definition der Service-Implementierung mit Bindung und Adresse -->
<wsdl:service name="myService">
    <wsdl:port name="myPort" binding="....">
      <jms:address  jndiDestinationName="OutQueue"
jndiReplyDestinationName="InQueue" jndiConnectionFactoryName="QueueConFac"
destinationStyle="queue">
        <jms:JMSNamingProperty
value="com.sun.jndi.fscontext.RefFSContextFactory"
name="java.naming.factory.initial" />
        <jms:JMSNamingProperty value="file:."
name="java.naming.provider.url" />
      </jms:address>
    </wsdl:port>
  </wsdl:service>

The router is deployed well into a spring container. But when I send a
message to the inbound interface, I _immediatly_ get a timeout exception
back. 

Here is what the log looks like:
  
FINE: Payload to be sent out is :[<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:gibDokumenteOperation
xmlns:ns1="http://vrs-schema.genoip.de/VRInfoForumDokumente"><ns3:gibDokumente
xmlns:ns2="http://vrs-schema.genoip.de/VRInfoForumDokumente/uebernehmeDokumente"
xmlns:ns3="http://vrs-schema.genoip.de/VRInfoForumDokumente/gibDokumente"
xmlns:ns4="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:ns5="http://www.genoip.de/protocol"><Organisation>?</Organisation><Optionen><Filter><DokumentID>?</DokumentID></Filter><VersandSynchron>true</VersandSynchron><DokumenteMitliefern>true</DokumenteMitliefern><AnhangMitliefern>true</AnhangMitliefern></Optionen></ns3:gibDokumente></ns1:gibDokumenteOperation></soap:Body></soap:Envelope>]
Jan 20, 2009 11:50:27 AM org.apache.cxf.transport.jms.JMSConduit
sendExchange
FINE: JMSConduit send message
.
.
.
INFO: Interceptor has thrown exception, unwinding now
java.lang.RuntimeException: Timeout receiving message with correlationId
dfrseai100_xn08693_Thread[qtp0-0 -
/CamelContext/VRInfoForumRouter,5,main]1232448628836
        at
org.apache.cxf.transport.jms.JMSConduit.sendExchange(JMSConduit.java:145)
        at
org.apache.cxf.transport.jms.JMSOutputStream.doClose(JMSOutputStream.java:56)
        at
org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:167)
        at
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
        at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:466)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:308)
        at
org.apache.camel.component.cxf.CxfProducer.invokeClient(CxfProducer.java:284)
        at
org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:192)
        at
org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:165)
        at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:43)
        at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:75)
        at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
        at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:173)
        at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:94)
        at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
        at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:66)
        at
org.apache.camel.component.cxf.CamelInvoker.invoke(CamelInvoker.java:178)
        at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:56)
        at
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
        at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:92)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
        at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:78)
        at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:278)
        at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:252)
        at
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
        at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:757)
        at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
        at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.mortbay.jetty.Server.handle(Server.java:320)

How can I configure the timeout behavior ? Feasible would be something like
"wait for XXX seconds, after that put the message to the dead letter error
handler". Or is there something I do fundamentally wrong ?

I'm using Artix 5.5 with camel 1.5.1.0. 

Many thanks in advance,
Mario
-- 
View this message in context: http://www.nabble.com/timeout-exception-when-pushing-a-message-to-a-JMS-Queue-tp21562561s22882p21562561.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: timeout exception when pushing a message to a JMS Queue

Posted by mario_horny <ma...@dzbank.de>.
Hi all,

I solved this using the JMSConfigFeature solution:
http://cwiki.apache.org/CXF20DOC/using-the-jmsconfigfeature.html

But I had to be careful with the wsdl File. In order to use the JMS
configuration from the config XML file, the <jms:address> has to be left
blank.

<!-- Definition der Service-Implementierung mit Bindung und Adresse -->
<wsdl:service name="myService">
    <wsdl:port name="myPort" binding="....">
      <jms:address>
      </jms:address>
    </wsdl:port>
  </wsdl:service>

Regards,
Mario


mario_horny wrote:
> 
> Hi guys,
> 
> I've got the following scenario. I want to receive a HTTP Message, put the
> received message into a queue, wait for response and give the response
> back as HTTP response.
> 
> My spring.xml looks like that:
> 
> <!-- define INBOUND interface of the router  -->
> <cxf:cxfEndpoint id="RouterIn" address="..."  serviceClass="..." >
> </cxf:cxfEndpoint>
> 
> <!-- define OUTBOUND interface of the router -->
> <cxf:cxfEndpoint id="RouterOut" 
> wsdlURL="mywsdl.wsdl"
> endpointName="myPort"
> serviceName="myService"
> serviceClass="..."
> </cxf:cxfEndpoint>
> 
> <!-- Define the route to the VR Infoforum service -->    		
> <camelContext id="camel"
> xmlns="http://activemq.apache.org/camel/schema/spring">
>   <route errorHandlerRef="myDeadLetterErrorHandler">
>      <from uri="cxf:bean:RouterIn" />
>      <to uri="cxf:bean:RouterOut" /> 
>    </route>
> </camelContext> 
> 
> <!-- error handling  -->
> <bean id="myDeadLetterErrorHandler"
> class="org.apache.camel.builder.DeadLetterChannelBuilder">
>    <!-- define dead letter endpoint for messages that cannot be routed -->
>    <!--  property name="defaultDeadLetterEndpointUri" value"TODO"/ -- >
>    <!-- reference the redelivery policy to use -->
>    <property name="redeliveryPolicy" ref="myRedeliveryPolicyConfig"/>
> </bean>
> 
> <!-- here we set the redelivery settings -->
> <bean id="myRedeliveryPolicyConfig"
> class="org.apache.camel.processor.RedeliveryPolicy">
>    <!-- try redelivery at most 0 times, after that the exchange is dead 
> -->
>       <property name="maximumRedeliveries" value="0"/>
> </bean>   
> 
> In the wsdl File, the JMS definitions are made whose values are resolved
> using a JNDI file:
> 
> <!-- Definition der Service-Implementierung mit Bindung und Adresse -->
> <wsdl:service name="myService">
>     <wsdl:port name="myPort" binding="....">
>       <jms:address  jndiDestinationName="OutQueue"
> jndiReplyDestinationName="InQueue" jndiConnectionFactoryName="QueueConFac"
> destinationStyle="queue">
>         <jms:JMSNamingProperty
> value="com.sun.jndi.fscontext.RefFSContextFactory"
> name="java.naming.factory.initial" />
>         <jms:JMSNamingProperty value="file:."
> name="java.naming.provider.url" />
>       </jms:address>
>     </wsdl:port>
>   </wsdl:service>
> 
> The router is deployed well into a spring container. But when I send a
> message to the inbound interface, I _immediatly_ get a timeout exception
> back. 
> 
> Here is what the log looks like:
>   
> FINE: Payload to be sent out is :[<soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:gibDokumenteOperation
> xmlns:ns1="http://vrs-schema.genoip.de/VRInfoForumDokumente"><ns3:gibDokumente
> xmlns:ns2="http://vrs-schema.genoip.de/VRInfoForumDokumente/uebernehmeDokumente"
> xmlns:ns3="http://vrs-schema.genoip.de/VRInfoForumDokumente/gibDokumente"
> xmlns:ns4="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
> xmlns:ns5="http://www.genoip.de/protocol"><Organisation>?</Organisation><Optionen><Filter><DokumentID>?</DokumentID></Filter><VersandSynchron>true</VersandSynchron><DokumenteMitliefern>true</DokumenteMitliefern><AnhangMitliefern>true</AnhangMitliefern></Optionen></ns3:gibDokumente></ns1:gibDokumenteOperation></soap:Body></soap:Envelope>]
> Jan 20, 2009 11:50:27 AM org.apache.cxf.transport.jms.JMSConduit
> sendExchange
> FINE: JMSConduit send message
> .
> .
> .
> INFO: Interceptor has thrown exception, unwinding now
> java.lang.RuntimeException: Timeout receiving message with correlationId
> dfrseai100_xn08693_Thread[qtp0-0 -
> /CamelContext/VRInfoForumRouter,5,main]1232448628836
>         at
> org.apache.cxf.transport.jms.JMSConduit.sendExchange(JMSConduit.java:145)
>         at
> org.apache.cxf.transport.jms.JMSOutputStream.doClose(JMSOutputStream.java:56)
>         at
> org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:167)
>         at
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
>         at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
>         at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
>         at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:466)
>         at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:308)
>         at
> org.apache.camel.component.cxf.CxfProducer.invokeClient(CxfProducer.java:284)
>         at
> org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:192)
>         at
> org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:165)
>         at
> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:43)
>         at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:75)
>         at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
>         at
> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:173)
>         at
> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:94)
>         at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
>         at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:66)
>         at
> org.apache.camel.component.cxf.CamelInvoker.invoke(CamelInvoker.java:178)
>         at
> org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:56)
>         at
> org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
>         at
> org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:92)
>         at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
>         at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:78)
>         at
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:278)
>         at
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:252)
>         at
> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
>         at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:757)
>         at
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
>         at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>         at org.mortbay.jetty.Server.handle(Server.java:320)
> 
> How can I configure the timeout behavior ? Feasible would be something
> like "wait for XXX seconds, after that put the message to the dead letter
> error handler". Or is there something I do fundamentally wrong ?
> 
> I'm using Artix 5.5 with camel 1.5.1.0. 
> 
> Many thanks in advance,
> Mario
> 

-- 
View this message in context: http://www.nabble.com/timeout-exception-when-pushing-a-message-to-a-JMS-Queue-tp21562561s22882p21586961.html
Sent from the Camel - Users mailing list archive at Nabble.com.