0

I am using camel and camel-restlet component for routing RESTFul web services. My route configuration looks like:

<from uri="restlet:/camel/my/path/{param1}/{param2}?restletMethods=PUT&throwExceptionOnFailure=false" />
<loadBalance inheritErrorHandler="false">
    <failover roundRobin="true" maximumFailoverAttempts="2">
    <exception>java.io.IOException</exception>
    </failover>
    <to uri="http://server1:8080/my/path/${header.param1}/${header.param2}?bridgeEndpoint=true&throwExceptionOnFailure=false" />
    <to uri="http://server2:8080/my/path/${header.param1}/${header.param2}?bridgeEndpoint=true&throwExceptionOnFailure=false" />
</loadBalance>

I have some input route configurations like:

restlet:/camel/my/path/{param1}/{param2}?restletMethods=PUT
restlet:/camel/my/path/param1/{param2}?restletMethods=GET

When a call comes as GET: /my/path/param1/foo, Restlet is routing this request to the first router and the request is failing with 404. I am expecting restlet to route this request to second router.
I went the post restlet-routing-nightmare, but in my case, I cannot change the URIs as I am just doing the routing part with camel and I have no control on the URIs of the underlying services. Underlying services are on Jersey framework and they don't have issues with these type of URL patterns.

Can anyone suggest a solution for this in restlet/camel.

Community
  • 1
  • 1
Joewyn
  • 55
  • 5

1 Answers1

0

You need to have throwExceptionOnFailure=true on the uris in the load balancer so the failover load balancer can react on the exception. Otherwise it assumes the process was successful.

Claus Ibsen
  • 56,060
  • 7
  • 50
  • 65