camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Mulder (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (CAMEL-533) ExceptionHandling & JMSReplyTo in @MessageDriven
Date Mon, 18 Aug 2008 16:23:52 GMT

     [ https://issues.apache.org/activemq/browse/CAMEL-533?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Aaron Mulder resolved CAMEL-533.
--------------------------------

    Fix Version/s: 1.4.0
                       (was: 1.5.0)
       Resolution: Fixed

I tried this again in 1.4 and it seems to have been fixed.

Specifically, with the default "activemq" component, when the bean throws an exception I see
a stack trace in the console (below) and the message is not redelivered.  If I use a custom
ActiveMQ component with transactions enabled, I see the same stack trace and then the message
is redelivered.

[aultMessageListenerContainer-7] EndpointMessageListener        WARN  Endpoint[customJMS:topic:AnnotationTest]
consumer caught an exception while processing JMS message: ActiveMQTextMessage {commandId
= 5, responseRequired = false, messageId = ID:hagrid.chariotsolutions.com-50882-1219076163784-0:2:1:1:1,
originalDestination = null, originalTransactionId = null, producerId = ID:hagrid.chariotsolutions.com-50882-1219076163784-0:2:1:1,
destination = topic://AnnotationTest, transactionId = null, expiration = 0, timestamp = 1219076164434,
arrival = 0, brokerInTime = 1219076164434, brokerOutTime = 1219076164434, correlationId =
null, replyTo = null, persistent = false, type = null, priority = 4, groupID = null, groupSequence
= 0, targetConsumerId = null, compressed = false, userID = null, content = null, marshalledProperties
= org.apache.activemq.util.ByteSequence@63676602, dataStructure = null, redeliveryCounter
= 0, size = 0, properties = {console=Wii, game=Dance Dance Revolution}, readOnlyProperties
= true, readOnlyBody = true, droppable = false, text = message text}
org.apache.camel.RuntimeCamelException: java.lang.IllegalStateException: This exception is
just to see what happens.
	at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:77)
	at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:531)
	at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:466)
	at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:435)
	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:316)
	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:235)
	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:887)
	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:822)
	at java.lang.Thread.run(Thread.java:637)
Caused by: java.lang.IllegalStateException: This exception is just to see what happens.
	at training.spring.AnnotationTest.doSomething(AnnotationTest.java:20)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:124)
	at org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:68)
	at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:110)
	at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:68)
	... 8 more
[aultMessageListenerContainer-7] efaultMessageListenerContainer WARN  Execution of JMS message
listener failed
org.apache.camel.RuntimeCamelException: java.lang.IllegalStateException: This exception is
just to see what happens.
	at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:77)
	at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:531)
	at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:466)
	at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:435)
	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:316)
	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:235)
	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:887)
	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:822)
	at java.lang.Thread.run(Thread.java:637)
Caused by: java.lang.IllegalStateException: This exception is just to see what happens.
	at training.spring.AnnotationTest.doSomething(AnnotationTest.java:20)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:124)
	at org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:68)
	at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:110)
	at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:68)
	... 8 more



> ExceptionHandling & JMSReplyTo in @MessageDriven
> ------------------------------------------------
>
>                 Key: CAMEL-533
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-533
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Aaron Mulder
>             Fix For: 1.4.0
>
>
> I have an ActiveMQ Queue and a Spring Bean.  The bean is set to throw an IllegalStateException
on 1/3 of all invocations.  The message publisher sets the JMSReplyTo destination, and there's
a listener on the reply queue.
> If I configure a route in XML <from uri="activemq:queue:Test"/><to uri="bean:MyBean:doSomething"
/> then when the exception is thrown, the bean is invoked a second time.  (I can tell as
the JMS Message ID is annotated into an argument to the doSomething method).  The reply queue
gets exactly one response for every request, regardless of the number of exceptions thrown
(I can tell as the JMSCorrelationID on the response is set to the incoming JMSMessageID using
an @OutHeaders annotated argument).
> If I drop the XML route and instead use @MessageDriven(uri="activemq:queue:Test") then
when the exception comes up, the message silently disappears.  There is no error emitted by
Camel, and the reply queue just never gets a message for those requests where the bean threw
an exception.
> This is unexpected -- I would have thought the configured routing and @MessageDriven
routing had exactly the same behavior when the route was the same.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message