Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-10777

failover not working for jetty endpoint

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • 2.16.3, 2.17.3
    • None
    • camel-core, camel-jetty
    • None
    • Unknown

    Description

      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>2</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

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            mborsky Miroslav Borsk√Ĺ
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: