Skip to content

Field routesToCache inner class AdaptCachedBodyGlobalFilter maybe should be modified #3406

Open
@Penough

Description

@Penough

Describe.
I noticed that it's a good way to use AdaptCachedBodyGlobalFilter to cache request body in the scenario of reuse.And I see it listening a EnableBodyCachingEvent event to judge whether or not to cache the request body.As a result, the field routesToCache will only have the entries with true value.I also notice the RetryGatewayFilterFactory use the event.Once I configure the routes with retry filter, the route will have the feature with caching request body permanently.I can't stop the behavior by revise the configuration in configuration center which support hot loading by refreshing routes.

	private ConcurrentMap<String, Boolean> routesToCache = new ConcurrentHashMap<>();
	@Override
	public void onApplicationEvent(EnableBodyCachingEvent event) {
		this.routesToCache.putIfAbsent(event.getRouteId(), true);
	}

Describe the solution you'd like
I think AdaptCachedBodyGlobalFilter should support one more event such as DisableBodyCachingEvent to set/delete the entry in routesToCache.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions