Skip to content

Migration Guide 2.3

Matej Novotny edited this page Sep 2, 2021 · 14 revisions

gRPC Server Interceptors

Global gRPC server interceptors have to be annotated with @io.quarkus.grpc.GlobalInterceptor since 2.3.

Prior to Quarkus 2.3, all the CDI beans implementing io.grpc.ServerInterceptor where considered global interceptors, i.e. applied to all gRPC services. Since 2.3, it is possible to make a service-specific interceptor, by adding @io.quarkus.grpc.RegisterInterceptor(MyInterceptor.class) on a gRPC service implementation. To easily distinguish between per-service interceptors and global ones, the aforementioned @GlobalInterceptor annotation has been introduced.

CDI @PreDestroy and @PostContruct methods on bean classes

Fixed a bug where @PreDestroy and @PostConstruct methods declared on bean classes were considered business methods which violated CDI specification rules. Therefore, starting with 2.3, an invocation of these methods will no longer be intercepted by any @AroundInvoke interceptors declared on the bean class and/or on these lifecycle methods.

This means that if you previously leveraged this scenario (for example to apply @Transactional to post construct callback), you will need to change your code. Here is an example of an approach that will still work:

@Dependent
class MyBean {
   @PostConstruct
   void init() {
     doInit(); // Interception works for self-invocation
   }
   
   @Transactional
   void doInit() {
     // ...e.g. save something in DB
   }
}

Current version

Migration Guide 3.18

Next version in main

Migration Guide 3.19

Clone this wiki locally