Same issue with circuitbreaker. The problem are the ReadOnlyHttpHeaders from netty.
java.lang.UnsupportedOperationException: null at org.springframework.http.ReadOnlyHttpHeaders.remove(ReadOnlyHttpHeaders.java:135)
https://docs.spring.io/spring-cloud-gateway/reference/spring-cloud-gateway/gatewayfilter-factories/removerequestheader-factory.html also not working.
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-circuitbreaker-reactor-resilience4j</artifactId>
</dependency>
spring:
cloud:
gateway:
routes:
- id: test-route
uri: id: test-route
uri: http://httpbin.org/
predicates:
- Path=/test/**
filters:
- StripPrefix=1
- name: CircuitBreaker
args:
name: exampleCircuitBreaker
fallbackUri: forward:/fallback