camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen" ...@silverbullet.dk>
Subject RE: Handling Bean exceptions
Date Sat, 07 Jun 2008 13:44:41 GMT
Hi Bruce

I have created ticket CAMEL-585 about the issues you mention in this forum.
When we have a ticket in JIRA your effort is not forgotten.
 

Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: Bruce Elmore [mailto:belmore@qualcomm.com] 
Sent: 7. juni 2008 01:59
To: camel-user@activemq.apache.org
Subject: RE: Handling Bean exceptions


Hi Claus,

I do believe that this issue (not returning an exception in the JMS
response) is indeed a bug. If you could get someone's attention about this,
I'd really appreciate it. That said, I think my workaround will be adequate,
although did discover a problem with my subclass of JmsProducer. Here's a
fixed version.

Thanks again for the help!

public class MyJmsProducer extends
org.apache.camel.component.jms.JmsProducer {

	public MyJmsProducer(JmsEndpoint endpoint) {
		super(endpoint);
	}

	@Override
	public void process(final Exchange exchange) {
		super.process(exchange);

		if (exchange.getOut() != null) {
			Object object =
((JmsEndpoint)getEndpoint()).getBinding().extractBodyFromJms(exchange,
				((JmsMessage) exchange.getOut()).getJmsMessage());

			if (object instanceof Throwable) {
				exchange.setException((Throwable) exchange.getOut().getBody());
				exchange.setOut(null);
			}
		}
	}
}


-- 
View this message in context: http://www.nabble.com/Handling-Bean-exceptions-tp17671948s22882p17703450.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message