We using custom gateway filter for spring cloud gateway. The configuration looks like below: Filter class:
@Component
public class CustomFilter extends AbstractGatewayFilterFactory<CustomFilter.Config> {
public static class Config {
private String type;
private LinkedMultiValueMap<String, String> values;
//Getters & Setters
}
@Override
public GatewayFilter apply(Config config) {
return (exchange, chain) -> {
//some filter function
};
}
}
spring:
cloud:
gateway:
routes:
- id: my-service
uri: https://myservice.host.com
predicates:
- Path=/api/{version}/api-name
filters:
- name: CustomFilter
args:
type: type1
values:
key1: value1
We want to add additional key value pair under values, like:
values:
key1: value1
key2: value2
I want to add additional key value pair and update configuration dynamically. I tried both /actuator/refresh and /actuator/gateway/refresh to update configuration but neither of them worked. Can someone help on how to update these values dynamically?