Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-2090

HTTP Gateway / Mapping Rules does not work anymore when we have different profiles

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Major Major
    • None
    • jboss-fuse-6.1
    • Fabric8 v1
    • % %

      JBoss Fuse 6.1-379 has been patched to SP2 (= version : 387) in order to work with the latest bug fixed for HTTP Gateway
      The scenario has been designed like that
      1) Install Fabric into the root container of Fuse 6.1-379
      2) Create a local container where we deploy the profile HTTP-Gateway
      3) Upload the the SP2 patch (using the FMC console). This patch is associated now with the profile 1.1
      4) Create another local container using the profile "example-quickstarts-rest" / profile version 1.0
      5) Make a test to check if you can access the REST service

      curl -i -H "Accept: application/xml" -X GET http://192.168.1.80:8183/cxf/crm/customerservice/customers/123
      
      HTTP/1.1 200 OK
      Content-Type: application/xml
      Date: Tue, 14 Oct 2014 10:14:05 GMT
      Transfer-Encoding: chunked
      Server: Jetty(8.1.14.v20131031)
      
      <?xml version="1.0" encoding="UTF-8" standalone="yes"?><Customer xmlns="http://rest.fuse.quickstarts.jboss.org/"><id>123</id><name>John</name></Customer>
      

      6) Make a test using the port 9000 of the http gateway and you will get an empty response

      curl -i -H "Accept: application/xml" -X GET http://192.168.1.80:9000/cxf/crm/customerservice/customers/123
      curl: (52) Empty reply from server
      

      The problem comes from the fact that when we update the list of MappedService we make the assumption that the gatewayVersion is the same as the service which is not the case here.
      By consequence, this line of code will flag remove = true (https://github.com/jboss-fuse/fuseenterprise/blob/fuseenterprise-1.0.0.redhat-387/gateway/gateway-fabric-support/src/main/java/org/fusesource/gateway/fabric/support/http/HttpMappingRuleBase.java#L106) and the cxf/crm servlet will not be mapped when the HTTP request is received
      This can be verified after looking to the log of the gateway

      With different profiles (1.0 for the REST container & 1.1 for the gateway

      Could not find matching proxy path for /cxf/crm/customerservice/customers/123 from paths: [servlets/io.fabric8.fabric-jolokia/jolokia/, servlets/io.fabric8.fabric-git-server/git/
      

      After migrating the container REST (version 1.0) to 1.1, that works

      Proxying request /cxf/crm/customerservice/customers/123 to service path: /cxf/crm/customerservice/customers/123 on service: http://192.168.1.80:8183/cxf/crm reverseServiceUrl: http://0.0.0.0:9000/cxf/crm
      

      Solutions :

      • Improve information reported into the log when we decide to remove a mappedService when the profiles versions are not the same
      • Warn the user that they are using different profile versions and the containers should be upgraded to the same version.
      • Remove the test to check the versions between the gateway and the services
      • ...

            atarocch@redhat.com Andrea Tarocchi (Inactive)
            cmoullia Charles Moulliard
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: