On Tue, Nov 11, 2008 at 8:14 AM, Tom Malone <[EMAIL PROTECTED]> wrote: > > I am using activemq but not camel, I want to add a property to the message, > before it arrives in the dlq, when an exception is thrown. I see this is > possible in camel, how was this done, is there anyway of doing this without > doing the dlq behaviour yourself.
Camel defines its own error handling and message processing mechanisms that are completely separate from that of ActiveMQ. So Camel actually consumes messages from destinations in ActiveMQ and processes them using it's own message model. This is what makes this type of message manipulation so easy in Camel. Take a look at the following section of the Camel dead letter channel page: http://activemq.apache.org/camel/dead-letter-channel.html#DeadLetterChannel-ExceptionPolicyStrategy(NewfeatureinCamel1.4) Notice the code examples where the setHeader() method is called. Adding a custom header to a message in Camel is this easy. For your situation, you could just define your own behavior for the onException() call and just define your custom header if that's all you want to do. Trying to do custom message processing inside of ActiveMQ is by no means easy to achieve. Camel is definitely the better solution for this type of work. Bruce -- perl -e 'print unpack("u30","D0G)[EMAIL PROTECTED]&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*" );' Apache ActiveMQ - http://activemq.org/ Apache Camel - http://activemq.org/camel/ Apache ServiceMix - http://servicemix.org/ Blog: http://bruceblog.org/