Spring Integration interceptor ordering (#4602)

This commit is contained in:
Trask Stalnaker 2021-11-08 11:59:44 -08:00 committed by GitHub
parent 300a982ac9
commit 1cddc96c8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -56,6 +56,11 @@ public class ApplicationContextInstrumentation implements TypeInstrumentation {
genericBeanDefinition(GlobalChannelInterceptorWrapper.class)
.addConstructorArgValue(SpringIntegrationSingletons.interceptor())
.addPropertyValue("patterns", SpringIntegrationSingletons.patterns())
// it is important for the tracing interceptor to run first for CONSUMER spans so
// that they capture the whole operation and also so that users can write their own
// interceptors to enrich the CONSUMER span (similar to writing a servlet filter to
// enrich the SERVER span)
.addPropertyValue("order", Integer.MIN_VALUE)
.getBeanDefinition();
((BeanDefinitionRegistry) beanFactory)