Since Random can't be mocked in jdk17+, replace the settable Random with Supplier<Double>. Production should still use ThreadLoacalRandom unless the supplier is set.
This moves the removal of GATEWAY_PREDICATE_PATH_CONTAINER_ATTR to ServerWebExchangeUtils.handle() which is now used in SpringCloudCircuitBreakerFilterFactory and ForwardRoutingFilter.
Fixes gh-2950
* Add metadata requestParam to /refresh specific routes
* Added requestParam that will be included in the event as a map of key:value pairs
* ScopedRefreshRoutesEvent: RefreshRoutesEvent was extended hierarchically to add metadata for filtering
* Modify CachingRouteLocator to filter in case the incoming event is ScopedRefreshRoutesEvent
* Change refresh by group for covering deletion
When all the routes in a group were deleted, the refresh were not done
---------
Co-authored-by: Spencer Gibb <sgibb@pivotal.io>
* Add a new endpoint POST /routes
A list of RouteDefinition can be sent to /routes using POST method to persist multiple routes by a single request.
Validation is done before persisting any RouteDefinition
Using
```yml
- StripPrefix=0
- LocalResponseCache=3m,1MB
- RemoveJsonAttributesResponseBody=args,data,files,Sec-Fetch-Dest,true
uri: https://httpbin.org
```
the Flux<DataBuffer> was replaced by other type, provoking a ClassCastException
When an invalid URI is configured in a routeDefinition, the endpoint for saving a route returns 201 Created response. However, the invalid route finally fails after calling `/refresh` endpoint.
If the developer configures more than one route, and the refresh fail because one route, all the routes are not persisted, leaving an inconsistent state
Fixes gh-2881
Having `response.bufferFactory().wrap(byteBuffer)` left the original DataBuffer without calling internally the `release()` method, which also decrease the counter of the incoming references to the object by Netty memory leak control.
This copy is not necessary and it was making Netty losing the object, causing memory Leak alert
[connected #2879]