Hi I think we have recently fixed so when doing request/reply over JMS with temp queues, Camel will now refresh and re-create destinations if the connection has failed / been recreated.
If you use fixed or exclusive queues then this happens already. See more details at the camel-jms doc page. On Thu, Jan 10, 2013 at 11:19 PM, Alan Smithee <[email protected]> wrote: > I am seeing the exception listed below after running a fairly straightforward > load test against jetty/activemq/camel. As best as I can make out, it occurs > only after I have run the test a few times (i.e. > start,finish,start,finish,start,exception), at which time all connections in > the test fail. One variable that seems to make a difference is how I define > the jms bean in the spring config. For performance reasons, I would really > like to use the maxConnections and concurrentConsumers values, but this > exception seems to only happen when I use the config that has those values. > > I'd be willing to share the project with interested parties if it's helpful > (its a fairly simple maven project) > > Details below.... > > > My Route > > from("jetty:http://localhost:8085/incoming?sessionSupport=true").routeId("Jetty > Endpoint to ActiveMQ") > > > .to("jms:incoming"); > > from("jms:incoming").routeId("ActiveMQ Incoming") > > .unmarshal(customGsonParser) > > .beanRef("dispatcher", "dispatch") > > .marshal(customGsonParser); > > My JMS Config That Does Not Produce The Exception > > <bean id="jms" class="org.apache.camel.component.jms.JmsComponent"> > <property name="connectionFactory"> > <bean > class="org.apache.activemq.ActiveMQConnectionFactory"> > <property name="brokerURL" > value="tcp://localhost:61616" /> > </bean> > </property> > </bean> > > My JMS Config That Produces The Exception > > <bean id="jmsConnectionFactory" > class="org.apache.activemq.ActiveMQConnectionFactory"> > <property name="brokerURL" value="tcp://localhost:61616" /> > </bean> > > <bean id="pooledConnectionFactory" > class="org.apache.activemq.pool.PooledConnectionFactory" > init-method="start" destroy-method="stop"> > <property name="maxConnections" value="100" /> > <property name="connectionFactory" ref="jmsConnectionFactory" > /> > </bean> > > <bean id="jmsConfig" > class="org.apache.camel.component.jms.JmsConfiguration"> > <property name="connectionFactory" > ref="pooledConnectionFactory" /> > <property name="concurrentConsumers" value="50" /> > </bean> > > <bean id="activemq" > class="org.apache.activemq.camel.component.ActiveMQComponent"> > <property name="configuration" ref="jmsConfig" /> > </bean> > > System Details > > java version : "1.7.0_07" > MacOS : 10.8.2 > maven-jetty-plugin : 6.1.26 > Jetty : 7.5.4.v20111024 > Camel : 2.10.2 > Apache ActiveMQ : 5.7.0 > > The Exception: > > [INFO] Started Jetty Server > 2013-01-10 16:53:54,426 [er[temporary]-1] WARN > efaultMessageListenerContainer - Setup of JMS message listener invoker > failed for destination 'temporary' - trying to recover. Cause: The Consumer > is closed > 2013-01-10 16:53:54,430 [er[temporary]-1] INFO PooledConnection > - failed to delete Temporary Queue > "temp-queue://ID:Ks-MacBook-Pro.local-64733-1357854558059-3:2:1" on closing > pooled connection: The connection is already closed > 2013-01-10 16:53:54,432 [sumer[incoming]] WARN > ultJmsMessageListenerContainer - Setup of JMS message listener invoker > failed for destination 'incoming' - trying to recover. Cause: The Consumer > is closed > 2013-01-10 16:53:54,447 [sumer[incoming]] INFO > ultJmsMessageListenerContainer - Successfully refreshed JMS Connection > 2013-01-10 16:53:54,451 [er[temporary]-1] INFO > efaultMessageListenerContainer - Successfully refreshed JMS Connection > 2013-01-10 16:53:54,462 [sumer[incoming]] WARN EndpointMessageListener > - Execution of JMS message listener failed. Caused by: > [org.apache.camel.RuntimeCamelException - > org.springframework.jms.InvalidDestinationException: Cannot publish to a > deleted Destination: > temp-queue://ID:Ks-MacBook-Pro.local-64733-1357854558059-3:2:1; nested > exception is javax.jms.InvalidDestinationException: Cannot publish to a > deleted Destination: > temp-queue://ID:Ks-MacBook-Pro.local-64733-1357854558059-3:2:1] > org.apache.camel.RuntimeCamelException: > org.springframework.jms.InvalidDestinationException: Cannot publish to a > deleted Destination: > temp-queue://ID:Ks-MacBook-Pro.local-64733-1357854558059-3:2:1; nested > exception is javax.jms.InvalidDestinationException: Cannot publish to a > deleted Destination: > temp-queue://ID:Ks-MacBook-Pro.local-64733-1357854558059-3:2:1 > at > org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1270) > at > org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:125) > at > org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:560) > at > org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:498) > at > org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467) > at > org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325) > at > org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263) > at > org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058) > at > org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050) > at > org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) > at java.lang.Thread.run(Thread.java:722) > Caused by: org.springframework.jms.InvalidDestinationException: Cannot > publish to a deleted Destination: > temp-queue://ID:Ks-MacBook-Pro.local-64733-1357854558059-3:2:1; nested > exception is javax.jms.InvalidDestinationException: Cannot publish to a > deleted Destination: > temp-queue://ID:Ks-MacBook-Pro.local-64733-1357854558059-3:2:1 > at > org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:285) > at > org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:168) > at > org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:469) > at > org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.send(JmsConfiguration.java:198) > at > org.apache.camel.component.jms.EndpointMessageListener.sendReply(EndpointMessageListener.java:353) > at > org.apache.camel.component.jms.EndpointMessageListener$EndpointMessageListenerAsyncCallback.done(EndpointMessageListener.java:206) > at > org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:108) > ... 11 more > Caused by: javax.jms.InvalidDestinationException: Cannot publish to a > deleted Destination: > temp-queue://ID:Ks-MacBook-Pro.local-64733-1357854558059-3:2:1 > at org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1731) > at > org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:277) > at > org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:212) > at > org.apache.activemq.pool.PooledProducer.send(PooledProducer.java:79) > at > org.apache.activemq.pool.PooledProducer.send(PooledProducer.java:62) > at > org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:592) > at > org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.doSend(JmsConfiguration.java:276) > at > org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.doSendToDestination(JmsConfiguration.java:215) > at > org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.access$100(JmsConfiguration.java:157) > at > org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate$4.doInJms(JmsConfiguration.java:200) > at > org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:466) > ... 15 more > 2013-01-10 16:54:15,428 [ecker[incoming]] WARN TemporaryQueueReplyManager > - Timeout occurred after 20000 millis waiting for reply message with > correlationID [ID-Ks-MacBook-Pro-local-64734-1357854558361-0-450553]. > Setting ExchangeTimedOutException on (MessageId: > ID-Ks-MacBook-Pro-local-64734-1357854558361-0-450550 on ExchangeId: > ID-Ks-MacBook-Pro-local-64734-1357854558361-0-450549) and continue routing. > 2013-01-10 16:54:15,431 [ecker[incoming]] ERROR DefaultErrorHandler > - Failed delivery for (MessageId: > ID-Ks-MacBook-Pro-local-64734-1357854558361-0-450550 on ExchangeId: > ID-Ks-MacBook-Pro-local-64734-1357854558361-0-450549). Exhausted after > delivery attempt: 1 caught: org.apache.camel.ExchangeTimedOutException: The > OUT message was not received within: 20000 millis due reply message with > correlationID: ID-Ks-MacBook-Pro-local-64734-1357854558361-0-450553 not > received. Exchange[Message: [Body is instance of > org.apache.camel.StreamCache]] > org.apache.camel.ExchangeTimedOutException: The OUT message was not received > within: 20000 millis due reply message with correlationID: > ID-Ks-MacBook-Pro-local-64734-1357854558361-0-450553 not received. > Exchange[Message: [Body is instance of org.apache.camel.StreamCache]] > at > org.apache.camel.component.jms.reply.ReplyManagerSupport.processReply(ReplyManagerSupport.java:133) > at > org.apache.camel.component.jms.reply.TemporaryQueueReplyHandler.onTimeout(TemporaryQueueReplyHandler.java:61) > at > org.apache.camel.component.jms.reply.CorrelationTimeoutMap.onEviction(CorrelationTimeoutMap.java:53) > at > org.apache.camel.component.jms.reply.CorrelationTimeoutMap.onEviction(CorrelationTimeoutMap.java:30) > at > org.apache.camel.support.DefaultTimeoutMap.purge(DefaultTimeoutMap.java:203) > at > org.apache.camel.support.DefaultTimeoutMap.run(DefaultTimeoutMap.java:159) > at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) > at > java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351) > at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) > at java.lang.Thread.run(Thread.java:722) > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Jetty-to-ActiveMQ-Failure-tp5725323.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: [email protected] Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
