Miroslav Borský created CAMEL-10777:
---------------------------------------

             Summary: failover not working for jetty endpoint
                 Key: CAMEL-10777
                 URL: https://issues.apache.org/jira/browse/CAMEL-10777
             Project: Camel
          Issue Type: Bug
          Components: camel-core, camel-jetty
    Affects Versions: 2.17.3, 2.16.3
            Reporter: Miroslav Borský
            Priority: Minor


The following proxy will accept incoming calls on http://localhost:8888/lb and 
respond to them.
{{<?xml version="1.0" encoding="UTF-8"?>
<blueprint xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 
https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"; 
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
        <camelContext id="test-ctx" 
xmlns="http://camel.apache.org/schema/blueprint";>
                <route streamCache="true">
                        <from 
uri="jetty:http://0.0.0.0:8888/lb/?matchOnUriPrefix=true"; />
                        <removeHeaders pattern="CamelServlet.*"/>
                        <removeHeaders pattern="CamelHttpServlet.*"/>
                        <removeHeader headerName="CamelHttpUri"/>
                        <loadBalance inheritErrorHandler="false">
                <failover maximumFailoverAttempts="1" />
                                <to 
uri="jetty:http://localhost:8889/1/?bridgeEndpoint=true&amp;throwExceptionOnFailure=true";
 />
                                <to 
uri="jetty:http://localhost:8888/2/?bridgeEndpoint=true&amp;throwExceptionOnFailure=false";
 />
                        </loadBalance>
                </route>
                <route>
                        <from 
uri="jetty:http://0.0.0.0:8888/2/?matchOnUriPrefix=true"; />
                        <setBody><constant>22</constant></setBody>
                </route>
        </camelContext>
</blueprint>
}}

When nothing runs on port 8889 (the first node in the failover), the expected 
behaviour is to respond always with the number 2.
The observed behaviour is, that service respond with returning the request back 
for the first call. If the second call is made within a short time (up to 30 
second in my case), the service will respond correctly.

Workaround is to use for example http4 instead of jetty:http.

Tried with camel 2.17.3 and 2.16.3



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to