You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wanted to override a base interceptor with another one, had tried adding ConditionalOnMissingBean but its not working and both the interceptors are registered.
@GrpcGlobalServerInterceptor
@Order(1100)
**@ConditionalOnMissingBean**(GrpcResponseServerInterceptor.class)
class BaseInterceptor extends ServerInterceptor # This is common interceptor (Usually in other modules this is fine)
@GrpcGlobalServerInterceptor
@Order(1100)
class CustomServiceInterceptor extends BaseInterceptor implements GrpcResponseServerInterceptor
Also tried Bean aware approach but got error while adding to HashBiMap (value already present)
beanFactoryAwareOrderComparator(final ApplicationContext context,
final Class<?> beanType) {
final Map<?, String> beans = HashBiMap.create(context.getBeansOfType(beanType)).inverse();
@GrpcGlobalServerInterceptor
@Order(999)
ServerInterceptor serverInterceptor() {
if (null != applicationContext.getBean(GrpcResponseServerInterceptor.class)) {
return applicationContext.getBean(GrpcResponseServerInterceptor.class);
}
return new BaseInterceptor();
}
The text was updated successfully, but these errors were encountered:
Wanted to override a base interceptor with another one, had tried adding ConditionalOnMissingBean but its not working and both the interceptors are registered.
Also tried Bean aware approach but got error while adding to HashBiMap (value already present)
The text was updated successfully, but these errors were encountered: