Skip to content

Document that TomcatConnectorCustomizers are not applied to additional connectors #38183

@Guy2You

Description

@Guy2You

Additional connectors can be created to add additional ports to the TomcatServletWebServerFactory by creating a WebServerFactorCustomizer bean and calling the addAdditionalTomcatConnectors() method, but connectors added this way do not have customization applied from application.properties as one might expect. This is the documented way of adding additional connectors as of 3.1.x doc.

This customization can be manually applied by calling getTomcatConnectorCustomizers(), then calling customize(connector) with each value from the collection returned. This seems to be a workaround instead of creating multiple TomcatWebServers. This could be problematic if there are multiple WebServerFactoryCustomizer beans within a project that call addContextCustomizer() resulting in inconsistent customization being applied to connectors added in different beans.

It should be clearer that connectors created in this way will not have this customization applied.

Related: #17144

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions