Timeout occurs when setting handled(true) for onException() in a SwitchYard Camel route

Solution Verified - Updated -

Issue

  • In a Camel route like the following, when an exception is thrown in the normal route and caught in the onException route, the message won't be replied back to the caller of the Camel service and thus eventually timeout exception happens at a service gateway binding:

    onException(Exception.class)
        .handled(true)
        .transform().simple("ERROR: ${exception.message}");
    
    from("switchyard://ProxyService")
        .handleFault()
        .to("switchyard://ReverseService")
        .transform().simple("OK: ${body}");
    
  • Note that this behaviour contradicts the normal behaviour of Camel, in which the following onException clause can send a response back to the caller:

    onException(Exception.class)
        .handled(true)
        .transform().simple("ERROR: ${exception.message}");
    

Environment

  • Red Hat JBoss Fuse Service Works (FSW)
    • 6.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In