On Wed, Jan 7, 2009 at 2:23 AM, harinair <har...@hotmail.com> wrote: > > Hi All: > > Thanks a lot for all the help I have received. We are nearing a production > implementation of a Camel based messaging system! It was a great experience, > I learned a lot and we saved a lot of time since I used Camel. > > I now have two questions: > > 1. I use org.apache.camel.spring.Main to start my standalone Camel context. > Now how do I stop it? Till now I was killing it. Can I kill it? I guess it > may not be the right way since I have a feeling that the messages in the > pipeline (especially the ones that are in Retry processing) is lost. How are you gonna run your application in production? Is it started from a command line or hosted in a container such as Tomcat? If you let Spring start Camel then Spring is handling the lifecycle of Camel, so when Spring is shutting down it will also shutdown Camel as well.
To avoid loosing messages you should use persistent JMS queues etc. that guarantees not to loose messages. > > 2. I really need to get access to the Message between each retry. I use > recipientList to forward message to different endpoints based on a header. I > have also retry rules which make the Endpoint retry a specific number of > times. In many cases I may have to get control and make some header > modification of the message before each retry. I could not find any good > docs on that. Is there any Strategy implementation I can use that can get > control of the exchange before each retry? If that is not there wouldn't it > be a good idea to provide a way to intercept messages before each retry? Didn't we discuss this? Well 1-3 months ago there was a discussion on this user forum about this topic. If you use onException you should be able do some custom processing before it's retried. Something like this: onException(MyException.class).process(new Processor() ... ) You can check the error handling documentation: http://activemq.apache.org/camel/error-handling-in-camel.html And the onException i here: http://activemq.apache.org/camel/exception-clause.html But I guess it could make sence to allow somekind of easy configuration of the error handler itself to attach a processor so end users can run some code before the retry is executed. > > Thanks in advance, > Hari Gangadharan > > -- > View this message in context: > http://www.nabble.com/Two-questions%3A-Stopping-Camel-and-intercept-before-retry-tp21323127s22882p21323127.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- /Claus Ibsen Apache Camel Committer Blog: http://davsclaus.blogspot.com/