Uploaded image for project: 'HTTP Connector'
  1. HTTP Connector
  2. HTTPC-26

When stopping/starting an HTTP Listener, basePath is concat again

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • To be reviewed
    • Resolution: Done
    • None
    • 1.5.13
    • Security Level: Public
    • S2
    • No
    • Production Defect
    • S2 (Regular)

    Description

      When an application defines an HTTP Listener with the basePath attribute, and the application is stopped/started (not restarted but through ARM for example) then when the listener is ready again the available paths now have the basePath twice in them.

      For example, I have the following app

      <?xml version="1.0" encoding="UTF-8"?>
      <mule xmlns="http://www.mulesoft.org/schema/mule/core"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:http="http://www.mulesoft.org/schema/mule/http"
            xmlns:api-gateway="http://www.mulesoft.org/schema/mule/api-gateway"
            xsi:schemaLocation="
             http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
             http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
             http://www.mulesoft.org/schema/mule/api-gateway http://www.mulesoft.org/schema/mule/api-gateway/current/mule-api-gateway.xsd">
      
          <api-gateway:autodiscovery apiId="1" flowRef="main"/>
      
          <http:listener-config name="httpConfig" basePath="api">
              <http:listener-connection host="localhost" port="${port}"/>
          </http:listener-config>
      
          <flow name="main">
              <http:listener config-ref="httpConfig" path="main"/>
              <logger message="Executing main" level="INFO"/>
          </flow>
      
      </mule>
      
      

      If I do a request to /api/main, then I get a successful 200 response.

      Then I stop it and start it again.

      If I do same request to /api/main, then I get an error 404 response.
      And the following logs are shown

      INFO  2019-12-03 21:44:08,350 [http.listener.09 SelectorRunner] org.mule.service.http.impl.service.util.DefaultRequestMatcherRegistry: No listener found for request: (GET)/api/main
      INFO  2019-12-03 21:44:08,350 [http.listener.09 SelectorRunner] org.mule.service.http.impl.service.util.DefaultRequestMatcherRegistry: Available listeners are: [([*])/api/api/main/]
      

      As it can be seen, now the HTTP Listener is expecting requests to /api/api/main instead of the original path

      Attachments

        Activity

          People

            ewerner@mulesoft.com Ezequiel Maximiliano Werner
            federico.balbi@mulesoft.com Federico Balbi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: