[英]Spring Boot replicate embedded servlet customizer to management port
我有一個自定義的WebServerFactoryCustomizer
但它不適用於管理端口。 使自定義可用於管理端口上的服務器的最佳方法是什么? 常規服務器在端口 = 8080 上,管理服務器在端口 = 8082 上。
我嘗試使用ServletManagementWebServerFactoryCustomizer
但它沒有用。 任何指針將不勝感激。
這是定制器(為 Undertow 禁用 TRACE)
public class UndertowCustomizer implements
WebServerFactoryCustomizer<ConfigurableUndertowWebServerFactory> {
@Override
public void customize(final ConfigurableUndertowWebServerFactory undertowWebServerFactory) {
undertowWebServerFactory.addDeploymentInfoCustomizers(deploymentInfo ->
deploymentInfo.addInitialHandlerChainWrapper(handler ->
new DisallowedMethodsHandler(handler, HttpString.tryFromString(HttpMethod.TRACE.name())))
);
}
}
事實上,我也覺得缺乏關於這個主題的信息,但我能夠按照文檔添加自定義端點來讓它工作
你能做的就是把定制器放在spring.factories 中
org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration=UndertowCustomizer
此類的 javadocs 也可能有幫助ManagementContextConfiguration
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.