0 Replies Latest reply on Feb 16, 2017 3:35 AM by Filip Kovář

    Camel-jetty bridgeEndpoint=true does not work

    Filip Kovář Newbie

      I have jetty route for bridge (proxy) to local services (services on local ports)  in JBoss Fuse 6.2.1. When public url is called request is served by local services and renturned back without redirection. When I use the same route in JBoss Fuse 6.3. the request is redirected (http 302) to local service. Local service is not publicly accessible.

       

      There is camel context:

      <blueprint 
      xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
           <camelContext id="_context1" xmlns="http://camel.apache.org/schema/blueprint">
                <route id="TestRoute">
                     <from id="_from1" uri="jetty:http://0.0.0.0/test?matchOnUriPrefix=true"/>
                     <to id="_to1" uri="jetty:http://localhost:8080/myservice?bridgeEndpoint=true&amp;throwExceptionOnFailure=false"/>
                </route>
           </camelContext>

       

      Do you have any idea where can be problem?

       

      UPDATED

      Between url parameters is "&amp;" not "&"

       

      I tried to change route again, again and again and I found out following strange behavior

      This route redirect to google and add url parameters from route: google.com?bridgeEndpoint=true&throwExceptionOnFailure=false

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
      <routes xmlns="http://camel.apache.org/schema/spring">
           <route customId="true" id="httpBridge">
                <from uri="jetty:http://0.0.0.0/test?matchOnUriPrefix=true"/>
                <to uri="jetty:https://google.com?bridgeEndpoint=true&throwExceptionOnFailure=false" customId="true" id="to2"/>
           </route>
      </routes>

      And this works as proxy (bridge). without redirect. Google shows 404 of course because http://google.cz/x doesn't exist. But url in browser is no changed (jboss-fuse-6308331.cloudapp.net/test)

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
      <routes xmlns="http://camel.apache.org/schema/spring">
           <route customId="true" id="httpBridge">
                <from uri="jetty:http://0.0.0.0/test?matchOnUriPrefix=true"/>
                <to uri="jetty:https://google.com/x?bridgeEndpoint=true&throwExceptionOnFailure=false" customId="true" id="to2"/>
           </route>
      </routes>

      Only one difference is letter "x" in the end of "to google" uri. For example letter "a" redirect to google as previous example