camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen" ...@silverbullet.dk>
Subject RE: setting dead Letter header in catch block?
Date Sat, 27 Sep 2008 06:25:28 GMT
Hi 

Could you try adding:
resultErrorEndpoint.exepectedMessagedReceived(1);

before this line:
resultErrorEndpoint.message(0).header(Constants.EXCEPTION_MESSAGE).isNotNull();



Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: Mick Knutson [mailto:mknutson@baselogic.com] 
Sent: 27. september 2008 01:45
To: Active MQ; Camel
Subject: Re: setting dead Letter header in catch block?

I have also tried:

        } catch (Exception e) {

log.error("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
            exchange.getOut().setHeader(Constants.EXCEPTION_MESSAGE,
e.getMessage() + ".....");
            throw new RuntimeException(e);
        }


But this does not work as my Mock still does not get the error:


resultErrorEndpoint.message(0).header(Constants.EXCEPTION_MESSAGE).isNotNull();


This is always null. Can someone help?



On Thu, Sep 25, 2008 at 5:18 PM, Mick Knutson <mknutson@baselogic.com>wrote:

> I have the following block that fails:
>
>         } catch (Exception e) {
>
> log.error("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
> *// i want to set deadLetter headers here ******
>             throw new RuntimeException(e);
>         }
>
>
> How can I set my dead letter headers as to the error that occurred? Or is
> there a better way?
>
>
> --
> ---
> Thank You...
>
> Mick Knutson
> BASE Logic, inc.
> (415) 354-4215
>
> Website: http://baselogic.com
> Blog: http://baselogic.com/blog
> BLiNC Magazine: http://blincmagazine.com
> Linked IN: http://linkedin.com/in/mickknutson
> DJ Mick: http://djmick.com
> MySpace: http://myspace.com/mickknutson
> Vacation Rental: http://tahoe.baselogic.com
>
>


-- 
---
Thank You...

Mick Knutson
BASE Logic, inc.
(415) 354-4215

Website: http://baselogic.com
Blog: http://baselogic.com/blog
BLiNC Magazine: http://blincmagazine.com
Linked IN: http://linkedin.com/in/mickknutson
DJ Mick: http://djmick.com
MySpace: http://myspace.com/mickknutson
Vacation Rental: http://tahoe.baselogic.com

Mime
View raw message