Customised Logging of Camel Route Errors and Exceptions

2013-09-17 Thread fordm
Hi, We use pattern matching to tail our log files for error messages of the form: matching on "MY_ERROR_CODE_", emails are then sent automatically. I therefore need any exceptions in a camel route to be log in such a format. I'd be interested in your views on the following solution: Create an

Camel Throttler - not throttling as expected

2013-08-28 Thread fordm
Hi, I have the following route (deployed into a FuseESB container): I would expect this route to produce one message every 30 seconds, which is split and throttled so that only three messages are logged out in a ten second period. What I actually see in the log is this: Observe the times of

Re: Rethrowing an exception using the Dead Letter Error Handler

2013-07-24 Thread fordm
Isn't it always the way. I've found the answer: org.apache.openjpa.persistence.PersistenceException true Who knows what I was trying t

Rethrowing an exception using the Dead Letter Error Handler

2013-07-24 Thread fordm
Hi, I've got a camel route that consumes from an activemq endpoint and persists the message to a database via jpa. If, for example, the connection to the database is lost I want to retry a message a few times and if it still fails put it on a Dead Letter Queue. This bit is fine:

Using a jpa endpoint with no entityClassName

2013-07-18 Thread fordm
Hi, The URI format for a jpa endpoint is: jpa:[entityClassName][?options] and according to Apache Camel:JPA , for sending to the endpoint, the entityClassName is optional. So I would expect the following route to successfully persist a message (that contains

Testing a route that set a CamelJmsDestinationName header

2013-07-01 Thread fordm
Hi, I have the following camel route (in blueprint): where myProcessor is a Camel Processor that set the CamelJmsDestinationName header in the message depending on some content in the message body. It's simple, and it works when I deploy it (into Fuse ESB). But I want to write a test for this r

Re: Messages "disappear" if fabric endpoint resolves to null / blank

2013-06-03 Thread fordm
Thanks Claus, I appreciate this is more of a fabric than a camel question, I'll repost to the FuseSource forum. I'm using Fuse version 7.1.0.fuse-047 and Camel 2.10.4 Cheers -- View this message in context: http://camel.465427.n5.nabble.com/Messages-disappear-if-fabric-endpoint-resolves-to-n

Messages "disappear" if fabric endpoint resolves to null / blank

2013-06-03 Thread fordm
HI, I've got a fairly simple camel route that uses a recipient list to route messages: fabric:${header.routeKey} The getRouteKey process refers to a bean that adds a "routeKey" field to the exchange header, which is then used as a lookup in the fabric registry.

Re: Intermittent NoSuchBeanException in a Camel Route Test

2013-05-29 Thread fordm
Thanks for the prompt response Claus, it seems to have done the trick. Out of interest, any thoughts on what makes it an intermittent problem? Is it something in the way / order the bean lookup occurs? -- View this message in context: http://camel.465427.n5.nabble.com/Intermittent-NoSuchBeanEx

Intermittent NoSuchBeanException in a Camel Route Test

2013-05-29 Thread fordm
Hi, I've got a pretty simple Blueprint Camel route, e.g. http://camel.apache.org/schema/blueprint";> ${body.getMyRequest} When depl

Re: Mocking an endpoint within a try-catch block

2013-02-07 Thread fordm
Claus Ibsen-2 wrote > Have you tried with > > weaveById(endpointId).replace().to(newUri); Removing the selectFirst I get the same result. However, if I use weaveByToString(uriPattern).selectFirst().replace().to(newUri); then the end point seems to be mocked successfully. Which is

Re: Mocking an endpoint within a try-catch block

2013-02-07 Thread fordm
I simply use context.getRouteDefinition(routeId).adviceWith(context, new AdviceWithRouteBuilder() { @Override public void configure() { weaveById(endpointId).selectFirst().replace().to(newUri); } }); Debugging the test I can see that the the endpoint IS being mocked:

Mocking an endpoint within a try-catch block

2013-02-07 Thread fordm
Hi, Using Camel 2.10, I'm writing a test for the following camel route, contained in a blueprint: java.lang.Exception If the smtpEndpoint is outside the doTry then I can happily mock the endpoint using adviceWith (and weaveById). Howe