Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document that TomcatConnectorCustomizers are not applied to additional connectors #38183

Closed
Guy2You opened this issue Nov 2, 2023 · 1 comment
Assignees
Labels
type: documentation A documentation update
Milestone

Comments

@Guy2You
Copy link

Guy2You commented Nov 2, 2023

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

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 2, 2023
@wilkinsona
Copy link
Member

Thanks for the suggestion but I don't think it makes sense to apply the same customization to every connector automatically. It would be a breaking change and it would also make it harder to have multiple connectors with different configuration. We can update the javadoc of addAdditionalTomcatConnectors() to make it clear that the factory will not apply its connection customizers to the additional connectors.

@wilkinsona wilkinsona changed the title Apply tomcat application.properties to connectors created for different ports Document that TomcatConnectorCustomizers are not applied to additional connectors Nov 2, 2023
@wilkinsona wilkinsona added type: documentation A documentation update and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 2, 2023
@wilkinsona wilkinsona added this to the 2.7.x milestone Nov 2, 2023
@mhalbritter mhalbritter self-assigned this Nov 3, 2023
@mhalbritter mhalbritter modified the milestones: 2.7.x, 2.7.18 Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation A documentation update
Projects
None yet
Development

No branches or pull requests

4 participants