Reputation: 166
Does Quarkus have a Spring AOP analogue? What could I use instead of Spring AOP on Quarkus?
Thank you!
Upvotes: 8
Views: 8721
Reputation: 5562
Quarkus uses CDI as a dependency injection mechanism, CDI provides interceptors that can be use to implement the same functionalities as AOP provides.
What you need to do is define an annotation, annotate the method you want to intercept with this annotation then define an interceptor bind to this annotation.
This is described here: https://quarkus.io/guides/cdi#interceptors and you can find more information on interceptors here: https://docs.jboss.org/weld/reference/latest/en-US/html/interceptors.html
Upvotes: 16