From 3605a8ea671afb9c57c5d7a71b42432005a5ec62 Mon Sep 17 00:00:00 2001 From: Viachaslau-Zinkevich Date: Sat, 14 Dec 2019 19:33:23 +0300 Subject: [PATCH] Fix CachingRouteLocator issue during routes initialization (#1460) --- .../cloud/gateway/route/CachingRouteLocator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;