diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/route/CachingRouteLocator.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/route/CachingRouteLocator.java index 230f05883..a31327e05 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/route/CachingRouteLocator.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/route/CachingRouteLocator.java @@ -16,9 +16,9 @@ package org.springframework.cloud.gateway.route; -import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import reactor.cache.CacheFlux; import reactor.core.publisher.Flux; @@ -37,7 +37,7 @@ public class CachingRouteLocator private final Flux routes; - private final Map cache = new HashMap<>(); + private final Map cache = new ConcurrentHashMap<>(); public CachingRouteLocator(RouteLocator delegate) { this.delegate = delegate;