On Wed, Jun 27, 2012 at 11:05 PM, twelve17 <s...@twelve17.com> wrote:
>
> Claus Ibsen-2 wrote
>>
>> I read this as you want to do some kind of AOP around the sending a
>> message
>> to a given endpoint?
>> We could possible make that a bit easier from testing point of view.
>>
>> What you can do with the advice with, and code you posted above is to
>> - enable the skip sending to endpoint option
>> - do assertion before
>> - send manually to the endpoint
>> - do assertion afterwards
>>
>
> Hi Claus,
>
> Apologies for the delay in replying.  I am trying to perform precisely the
> steps you have outlined, perhaps a little less AOP-like than the example
> above, at least for the moment.  :)
>
> I have not been able to figure out which API to use to send manually to the
> endpoint within the processor before hand.  In other words, if my
> RouteBuilder looks like this:
>
> @Override
>  public void configure() throws Exception {
>
> interceptSendToEndpoint("bean:someEndpointToBeTested").skipSendToOriginalEndpoint().process(new
> DoSomeAssertionProcessor());
> }
>
> And my processor looks like this:
>
> public class DoSomeAssertionProcessor implements Processor {
>
>    @Override
>    public void process(Exchange exchange) throws Exception {
>                // 1. do pre endpoint assertion
>                // 2. send to original endpoint here, perhaps using
> NotifyBuilder to wait for it to finish?
>                // 3. do post endpoint assertion
>    }
> }
>
> How do I accomplish #2?  Should I just use a standard producer template?
>

Yeah a producer template would be fine. Then you can just send the
exchange to the endpoint.


> Regards,
>
> Alex
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/testing-intercept-route-and-process-after-its-completion-tp5714460p5715186.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to