Hello All, I am trying to use Camel to write a simple monitoring application. I want to check to try to connect to multiple URLs and then if any of them fail, send an email altering an admin.
My strategy was to use timer to run the application at a given interval and then create a dynamic Recipient List of the URLs and catch any exceptions. Here is an example (using a static recipient list for simplicity): <camel:camelContext xmlns="http://camel.apache.org/schema/spring" id="camel"> <route> <from uri="timer://foo?fixedRate=true&period=60000"/> <doTry> <setHeader headerName="CamelHttpMethod"> <constant>GET</constant> </setHeader> <recipientList delimiter=","> <constant>https://fail.test.com, https://succeed.test.com,https://fail2.test.com</constant> </recipientList> <doCatch> <exception>java.lang.Exception</exception> <camel:setBody><simple>URL that is failing: ${exception.message}</simple></camel:setBody> <to uri="file:/home/yogesh/Desktop/pickup/Error"/> </doCatch> </doTry> </route> </camel:camelContext> What I find is that both URL fail1 and fail2 throw exceptions, however, the catch block will only display the second exception in the exception.message expression. Is there a way to save a history of all the exceptions? Is there a way to enter the catch block multiple times? Is there a different way to setup my route that is better than recipient list? I have a spring config file that already has the list of URLs that need to be called so I just want to read that file, do an HTTP GET and if there is an error route to an error URI. Any help would be appreciated. Thanks, Yogesh -- View this message in context: http://old.nabble.com/Recipient-List---Multiple-Exceptions-tp26803513p26803513.html Sent from the Camel - Users mailing list archive at Nabble.com.