-
Notifications
You must be signed in to change notification settings - Fork 41.5k
Description
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 TomcatWebServer
s. 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