Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In spring-boot version 3.2.3, interceptors are not called in order of addition in InterceptorRegistry #39796

Closed
PrashantGuptaM opened this issue Feb 29, 2024 · 1 comment
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid

Comments

@PrashantGuptaM
Copy link

PrashantGuptaM commented Feb 29, 2024

Some changes happened in new spring-boot 3.2.3 library, to align with the new version I changed my application code
"class Appconfig extends WebMvcConfigurerAdapter" changed to "class AppConfig implements WebMvcConfigurer" and
"class AppTenantInterceptor extends HandlerInterceptorAdapter" changed to "class TenantInterceptor implements HandlerInterceptor"

because above spring classes (WebMvcConfigurerAdapter, HandlerInterceptorAdapter) are removed hence we had to do these changes.

now with these changes in multitenant application we are adding the interceptors in below order

@Override
public void addInterceptors(InterceptorRegistry registry) {
    registry.addInterceptor(tenantInterceptor);
    registry.addInterceptor(cmsInterceptor);
    registry.addInterceptor(authorizationInterceptor);
}

so it should be called in sequence however, during logout tenantInterceptor & cmsInterceptor are not getting called before invoking EventListener below.

@eventlistener(condition = "#event.info.getState() == T(com.app.mod.event.state.UserSessionInfo.State).LOGOUT")
public void onUserLogout(UserSessionState event){...}

In Old spring-boot 2.7.18 request going in order of addition in InterceptorRegistry as expected and working fine in our application.

Kindly look at this issue and share if you have any suggestion or fix to make it work like before as it was working in old spring-boot

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 29, 2024
@wilkinsona
Copy link
Member

The code that you're asking about is part of Spring Framework (none of it is in an org.springframework.boot package) so please raise a Spring Framework issue.

@wilkinsona wilkinsona closed this as not planned Won't fix, can't repro, duplicate, stale Feb 29, 2024
@wilkinsona wilkinsona added status: invalid An issue that we don't feel is valid for: external-project For an external project and not something we can fix and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

3 participants