Re: Need an interceptSendTo hook

2016-04-23 Thread Claus Ibsen
On Fri, Apr 22, 2016 at 9:11 PM, Jeff Segal wrote: > Actually, one thing I just considered was that the id() DSL doesn't appear > to support an expression, so generating it dynamically may not be possible > (something I was hoping to be able to do in a second weave spot). Right now > I'm actually

Re: Need an interceptSendTo hook

2016-04-22 Thread Jeff Segal
Actually, one thing I just considered was that the id() DSL doesn't appear to support an expression, so generating it dynamically may not be possible (something I was hoping to be able to do in a second weave spot). Right now I'm actually using the 'browse' component + recipient list for my test ho

Re: Need an interceptSendTo hook

2016-04-22 Thread Jeff Segal
Awesome, thanks Claus. I switched to using weaveById and got the exact behavior that I wanted in my actual route (weaveByType could work too but is a bit less explicit). For the benefit of others, this is how I'd switch my route DSL from what I sent earlier: from("direct:start") .setBody(

Re: Need an interceptSendTo hook

2016-04-22 Thread Claus Ibsen
On Fri, Apr 22, 2016 at 6:23 PM, Jeff Segal wrote: > Minh - that's exactly what I'm trying to do. The issue is that I don't have > a great hook to insert my advice where I want. > > Claus - here's a rough example: > > from("direct:start") > .setBody().constant(someXml) > .split().x

Re: Need an interceptSendTo hook

2016-04-22 Thread Jeff Segal
Minh - that's exactly what I'm trying to do. The issue is that I don't have a great hook to insert my advice where I want. Claus - here's a rough example: from("direct:start") .setBody().constant(someXml) .split().xpath(anXpathExpression) .setHeader("myHeader", constan

Re: Need an interceptSendTo hook

2016-04-22 Thread Claus Ibsen
On Thu, Apr 21, 2016 at 8:18 PM, Jeff Segal wrote: > I've got a route that I'd like to do some unit testing on at various > stages. It does a few splits, sets some headers, etc. The problem is that > there's no actual endpoint for me to intercept until the very end, but I'd > like to do some verif

Re: Need an interceptSendTo hook

2016-04-21 Thread Minh Tran
Hi Jeff Did you know that you could weave in mock end points anywhere in your route during unit testing? That way it doesn’t pollute your production route while your application is running normally. http://camel.apache.org/advicewith.html Does that h

Re: Need an interceptSendTo hook

2016-04-21 Thread Brad Johnson
By the way, I noticed that as of Camel 2.16 they've added an "ignoreInvalidEndpoint" flag which may be for exactly the reasons you need. During testing you'd set up an endpoint to receive messages but in production those test endpoints, not used for monitoring, wouldn't have endpoints associated w

Re: Need an interceptSendTo hook

2016-04-21 Thread Brad Johnson
I'll let others comment on this more fully but will make on observation that will depend very much on your needs outside of testing. The wiretap allows you to get a full copy of an exchange and send it off on a separate route. That is actually a good mechanism if you might later use that for moni

Need an interceptSendTo hook

2016-04-21 Thread Jeff Segal
I've got a route that I'd like to do some unit testing on at various stages. It does a few splits, sets some headers, etc. The problem is that there's no actual endpoint for me to intercept until the very end, but I'd like to do some verification midway through. I suppose I could add arbitrary moc