Hi Vadim

Yes this is a bad example. I do think the author was trapped with the fact that 
the PacketListener interface doesn't allow throwing checked exceptions.

What you should do is wrap it in a RuntimeExchangeException.

Camel-core will and should handle the exception, if the component itself can 
not deal with it (and this is the case in most situations).

Great that you are working on the patches and thus can improve and fix this 
component in Camel. Always good with new eyes ;)


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

-----Original Message-----
From: Vadim Chekan [mailto:[EMAIL PROTECTED] 
Sent: 30. juli 2008 09:54
To: [email protected]
Subject: Exception handling in endpoint

Fragment from xmpp code:

XmppExchange exchange = endpoint.createExchange(message);
try {
     getProcessor().process(exchange);
} catch (Exception e) {
// TODO: what should we do when a processing failure occurs??
       e.printStackTrace();
}


Question: isn't hiding exceptions the worst possible option?
I would expect camel core to handle exceptions properly so that 
endpoints do not have to deal with it. Am I right?

Vadim.

Reply via email to