-
Notifications
You must be signed in to change notification settings - Fork 55
Request forwarding interceptors
Mariusz Kopylec edited this page Jun 9, 2019
·
21 revisions
Most of the Charon's features are represented by request forwarding interceptors. An interceptor allows to modify outgoing requests and incoming responses. Every interceptor has an order that defines when the particular interceptor will be invoked. Some of the interceptors are added to Charon configuration by default, some can be added manually. Interceptors can be freely set and unset globally and per request mapping:
import static com.github.mkopylec.charon.configuration.CharonConfigurer.charonConfiguration;
import static com.github.mkopylec.charon.configuration.RequestMappingConfigurer.requestMapping;
@Configuration
class CharonConfiguration {
@Bean
CharonConfigurer charonConfigurer() {
return charonConfiguration()
.set(<interceptor>)
.unset(<interceptor order>)
.add(requestMapping("mapping name")
.set(<interceptor>)
.unset(<interceptor order>));
}
}An interceptor can be overwritten by setting an interceptor which has the same order. Charon contains the following request forwarding interceptors: