Claus Ibsen created CAMEL-27905:
-----------------------------------

             Summary: camel-jetty: sslSocketConnectors and socketConnectors 
cannot work, filterInitParameters has the wrong prefix, a custom threadPool is 
stopped with the first port
                 Key: CAMEL-27905
                 URL: https://issues.apache.org/jira/browse/CAMEL-27905
             Project: Camel
          Issue Type: Bug
          Components: camel-jetty
            Reporter: Claus Ibsen
             Fix For: 4.25.0


Found while improving the option descriptions of camel-jetty for CAMEL-23832 
(pull request https://github.com/apache/camel/pull/31165).
These are separate problems of the component; the descriptions change only 
documents the current behavior.

h4. 1. sslSocketConnectors and socketConnectors cannot work
{{JettyHttpComponent}} creates a new Server per port and calls 
server.addConnector(userConnector), but Jetty 12 Server.addConnector throws 
IllegalArgumentException when connector.getServer() != this, and a user cannot 
build a connector for a Server that Camel creates later. ExplicitHttpsRouteTest 
only passes because its helper returns null connectors.
Proposed change: deprecate both options, or offer a connector factory that gets 
the Server.

h4. 2. filterInitParameters has the wrong prefix
The @UriParam declares the prefix "filter." but createEndpoint extracts 
"filterInit." (the tests and the CORS code use filterInit.), so the catalog and 
the DSL show the wrong prefix and filter.x is silently ignored.
Proposed change: change the prefix to "filterInit.".

h4. 3. A custom threadPool is stopped with the first port
The same threadPool instance is passed to new Server(threadPool) for every 
port; the first Server adopts the not-started pool as a managed bean, so 
stopping that port also stops the pool the other ports use.
Proposed change: start and stop a custom pool in the component lifecycle.

h4. 4. requestBufferSize and socketConnectorProperties are not applied
{{JettyHttpComponent12.createConnectorJettyInternal}} has the requestBufferSize 
setter call commented out (Jetty 12.1 has 
HttpConfiguration.setInputBufferSize); socketConnectorProperties are stored but 
never read.
Proposed change: map requestBufferSize to setInputBufferSize, and bind 
socketConnectorProperties as sslSocketConnectorProperties are, or deprecate 
them.

h4. 5. proxyHost without proxyPort throws a NullPointerException
In createEndpoint, when proxyHost is set without proxyPort, 
endpoint.setProxyPort(null) unboxes into setProxyPort(int). Both options have 
no effect, since jetty only consumes.
Proposed change: deprecate both.

h4. 6. Smaller issues
enableMultipartFilter has default false in the metadata, but the component 
turns it on unless the URI sets it (only the Rest DSL turns it off). Several 
component options have no label (enableJmx, requestBufferSize, 
requestHeaderSize, responseBufferSize, responseHeaderSize, 
useXForwardedForHeader, enableMultipartFilter); socketConnectors and 
socketConnectorProperties are labelled security. The component httpBinding and 
httpConfiguration setters always throw IllegalArgumentException.


_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to