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

Setting a clientConfig parameter always creates new cookie store per endpoint

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.23.2
    • 2.23.3, 2.24.1, 3.0.0
    • camel-ahc
    • None
    • Unknown

    Description

      If a clientConfig parameter is defined for an ahc endpoint, a new cookie store will be created on the endpoint, regardless of the configuration set to the clientConfig parameter.

      This makes it impossible to have an endpoint without a cookie store, when this parameter is set (which also means that the clientConfig parameter and the cookieHandler paramter do not work together).

      The root cause for this issue is that AhcComponent.cloneConfig() is called at several places in the code to create a configuration builder from the provided configuration. This method is calling new DefaultAsyncHttpClientConfig.Builder(clientConfig), to create that new builder, but this call will create a new cookie store on each invocation and provide it to the new builder. This means even if the cookie store is set to null in the provided configuration the client for the endpoint will be created with a cloned configuration, which will then have a new cookie store.

      Attachments

        Activity

          People

            siano Stephan Siano
            siano Stephan Siano
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: