Maintaining state/context in Spring Cloud gateway across multiple filters

Viewed 351

We are using Spring cloud gateway filters for doing JwtToken based authentication & manipulating request/response headers in multiple gateway filters. Is it possible to pass state/context across multiple filters without adding that state either to Request Body, Headers, or Parameters?

We can't depend on ThreadLocal as Gateway doesn't guarantee the execution of all filters in a single thread.

Thanks in advance.

1 Answers

use attributes in ServerWebExchange.

Related