camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Arnold <carn...@ptc.com>
Subject Re: Log after choice in java DSL
Date Tue, 21 Jan 2014 21:29:24 GMT
That did the trick.  Thanks!

-Chris

On 01/21/2014 03:10 PM, Richard Kettelerij wrote:
> Try replacing endChoice() with end().
>
>
> On Tue, Jan 21, 2014 at 6:55 PM, Christopher Arnold <carnold@ptc.com> wrote:
>
>> I working on a test that sets up a CXF REST endpoint and then routes the
>> request to various beans depending on the operation.  I'm trying to include
>> a log entry after the choice statement that sends the request to the beans
>> to log what the response looks like.  Source code:
>>
>> @Override
>> protected RouteBuilder createRouteBuilder() {
>>      return new RouteBuilder() {
>>          @Override
>>          public void configure() {
>>              from("cxfrs://local://rest?resourceClasses=com.company.
>> FooService")
>>                  .setExchangePattern(ExchangePattern.InOut)
>>                  .to("log:com.company.foo?level=INFO&showAll=true")
>>                  .choice()
>>                      .when(header("operationName").isEqualTo("opA"))
>>                          .to("bean:beanA")
>>                      .when(header("operationName").isEqualTo("opB"))
>>                          .to("bean:beanB")
>>                      .otherwise()
>>                          .log("Bad operation")
>>                  .endChoice()
>>                  .to("log:com.company.foo?level=INFO&showAll=true")
>>          }
>>      };
>> }
>>
>> My issue is that only the first .to("log.... statement seems to be
>> executed.  Any idea what I'm doing wrong?
>>
>> Version detail: Camel 2.12.2, CXF 2.7.7, Java 1.7.0_45
>>
>> Thanks,
>> -Chris
>>


Mime
View raw message