Denis Misin created CAMEL-21958:
-----------------------------------

             Summary: Wrong "otherwise" is triggered
                 Key: CAMEL-21958
                 URL: https://issues.apache.org/jira/browse/CAMEL-21958
             Project: Camel
          Issue Type: Bug
    Affects Versions: 4.11.0
            Reporter: Denis Misin


    from("direct:_getEmployeeContacts")
      .errorHandler(noErrorHandler())
      .choice()
        .when(exchangeProperty(EMPLOYEE_CONTACTS))
          .transform(exchangeProperty(EMPLOYEE_CONTACTS))
        .otherwise()
          .to("direct:_processHeaders")
          .setHeader(Exchange.HTTP_METHOD, constant("GET"))
          .log("Getting employee contacts ")
          
.toD("https://${exchangeProperty."+INPUT_MESSAGE+"?.metadata?.url}/{{api.base}}/employees/${exchangeProperty."+EMPLOYEE_ID+"}/employeeContacts?throwExceptionOnFailure=false";)
          .choice()
            .when(simple("${header."+Exchange.HTTP_RESPONSE_CODE+"} == 200"))
              .unmarshal(new 
ListJacksonDataFormat(EmployeeContactAPIModel.class))
              .endChoice()
            .otherwise()
              .to("direct:_httpError")
          .end()
      .end();

This code stopped working after Camel upgrade from 4.0 to 4.11.
The last otherwise is always hit.
https://camel.zulipchat.com/#narrow/channel/257298-camel/topic/Nested.20choice/near/511800701



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to