Adds property to disable RouteRefreshListener

Fixes gh-2958
This commit is contained in:
sgibb
2024-03-11 22:44:10 -04:00
parent df81812e4d
commit b594bc4cbb
2 changed files with 7 additions and 0 deletions

View File

@@ -264,6 +264,7 @@ public class GatewayAutoConfiguration {
@Bean
@ConditionalOnClass(name = "org.springframework.cloud.client.discovery.event.HeartbeatMonitor")
@ConditionalOnProperty(prefix = GatewayProperties.PREFIX, name = ".route-refresh-listener.enabled", matchIfMissing = true)
public RouteRefreshListener routeRefreshListener(ApplicationEventPublisher publisher) {
return new RouteRefreshListener(publisher);
}

View File

@@ -424,6 +424,12 @@
"type": "java.lang.Boolean",
"description": "Include the port in matching the host name.",
"defaultValue": "true"
},
{
"name": "spring.cloud.gateway.route-refresh-listener.enabled",
"type": "java.lang.Boolean",
"description": "If RouteRefreshListener should be turned on.",
"defaultValue": "true"
}
]
}