[
https://issues.apache.org/activemq/browse/SMXCOMP-599?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Christoph Meise updated SMXCOMP-599:
------------------------------------
Attachment: patch-test-smxcomp599.txt
Please find attached a patch to reproduce the described behaviour. Simply apply
it to the head revision of trunk and run it as JUnit test case. You'll see that
of the two messages that should be received only one is actually received. A
thread dump shows this:
Thread [main] (suspended)
Unsafe.park(boolean, long) line: not available [native method]
LockSupport.park() line: not available
AbstractQueuedSynchronizer.parkAndCheckInterrupt() line: not available
CountDownLatch$Sync(AbstractQueuedSynchronizer).doAcquireSharedInterruptibly(int)
line: not available
CountDownLatch$Sync(AbstractQueuedSynchronizer).acquireSharedInterruptibly(int)
line: not available
CountDownLatch.await() line: not available
AsyncProcessorHelper.process(AsyncProcessor, Exchange) line: 49
UnitOfWorkProcessor(DelegateAsyncProcessor).process(Exchange) line: 66
CamelProviderEndpoint.handleActiveProviderExchange(MessageExchange) line: 95
CamelProviderEndpoint.process(MessageExchange) line: 74
CamelJbiComponent(AsyncBaseLifeCycle).doProcess(Endpoint, MessageExchange)
line: 627
CamelJbiComponent(AsyncBaseLifeCycle).processExchange(MessageExchange) line:
581
CamelJbiComponent(AsyncBaseLifeCycle).onMessageExchange(MessageExchange) line:
535
SyncLifeCycleWrapper.onMessageExchange(MessageExchange) line: 60
DeliveryChannelImpl.processInBound(MessageExchangeImpl) line: 620
STFlow(AbstractFlow).doRouting(MessageExchangeImpl) line: 172
STFlow.doSend(MessageExchangeImpl) line: 49
STFlow(AbstractFlow).send(MessageExchange) line: 123
DefaultBroker.sendExchangePacket(MessageExchange) line: 283
SpringJBIContainer(JBIContainer).sendExchange(MessageExchangeImpl) line: 894
DeliveryChannelImpl.doSend(MessageExchangeImpl, boolean) line: 395
DeliveryChannelImpl.send(MessageExchange) line: 431
DefaultServiceMixClient.send(MessageExchange) line: 148
SmxComp599.testErrorHandledByExceptionClause() line: 81
...
The main thread is actually waiting to be notified in the AsyncProcessorHelper.
Btw this case shows that the behaviour also occurs with the straight through
flow.
> <onException> Tag leaves container hanging in conjunction with
> servicemix-camel and servicemix-jms
> --------------------------------------------------------------------------------------------------
>
> Key: SMXCOMP-599
> URL: https://issues.apache.org/activemq/browse/SMXCOMP-599
> Project: ServiceMix Components
> Issue Type: Bug
> Components: servicemix-camel
> Affects Versions: servicemix-camel-2008.01, servicemix-camel-2009.01,
> servicemix-camel-2009.02, servicemix-jms-2008.01
> Environment: Especially out of the box installation of ServiceMix 3.3
> using several servicemix-camel-installer
> Reporter: Christoph Meise
> Fix For: servicemix-camel-2009.02
>
> Attachments: patch-test-smxcomp599.txt, reproduce-deadlock.jar
>
>
> The <onException> tag does not work as expected. Using this spring definition
> within a camel service unit:
> <spring:bean id="exceptionThrower"
> class="de.cme.bug.report.ExceptionThrower"/>
> <camelContext id="reproduce-deadlock-context">
> <endpoint id="consumer-messages"
> uri="jbi:endpoint:http://www.cme.de/consumerMessages/endpoint" />
> <endpoint id="provider-failed-messages"
> uri="jbi:endpoint:http://www.cme.de/producerErrorData/endpoint" />
> <route>
> <from ref="consumer-messages"/>
> <bean ref="exceptionThrower"/>
> <to uri="log:success.logger"/>
>
> <onException>
> <exception>java.lang.Exception</exception>
> <handled>
> <constant>true</constant>
> </handled>
> <to ref="provider-failed-messages"/>
> </onException>
>
> </route>
> </camelContext>
> Incoming messages can be provided using servicemix-jms means and in an
> exception the message should be forwarded to a jms provider. The
> ExceptionThrower - as it says - allows throws an IOException. Now if an
> Exception occurs like:
> ERROR - DeadLetterChannel - Failed delivery for exchangeId:
> ID-isdeblnws324/3179-1248190130315/0-0. On delivery attempt: 0 caught:
> java.io.IOExcept
> ion
> java.io.IOException
> at
> de.cme.bug.report.ExceptionThrower.process(ExceptionThrower.java:10)
> at
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:80)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:80)
> at
> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:189)
> at
> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:133)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:115)
> .
> . more stacktrace
> .
> ERROR - DeadLetterChannel - Failed delivery for exchangeId:
> ID-isdeblnws324/3179-1248190130315/0-0. Handled by the failure processor:
> sendTo(Endpoi
> nt[endpoint:http://www.cme.de/producerErrorData/endpoint])
> I can see the <onException> definition doing the handling. But having had one
> Exception handled, no more messages will be consumed later on. Getting a
> thread dump I don't see any blocked threads. Also the effect is not depending
> on the type of flow (seda or jms).
> I can provide a sample service assembly allowing reproduction of this
> behaviour if needed. I would attach it to this issues if I knew how. Right
> now I circumvent the issue using the try/catch construct, but I'd rather have
> an asynchronous error handling provided by the onException handler.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.