A S
A S

Reputation: 85

Axon MIgration from 2.4 to 3.1

Whats the use of @AnnotationDriven in AXON, do we still have this annotation in AXON 3.1.

import org.axonframework.contextsupport.spring.AnnotationDriven;

I was working on migration and this particular library is showing error in 3.1 which was fine in 2.4

Upvotes: 1

Views: 102

Answers (1)

Steven
Steven

Reputation: 7275

The @AnnotationDriven was contained in the axon-core dependency, but has been moved to the axon-spring dependency. So you're still able to use it, but you'll have to wire in another dependency.

Besides that though, if you're moving to the latest version of Axon (3.1.1 atm), I suggest using other ways to wire all Axon components:

  1. The Configurer API, which provides you with a more fluent way to configure all required Axon components. Typically used in a non-Spring environment.
  2. If you're on a Spring Boot application, wire the axon-spring-boot-starter dependency. This will out of the box wire all the required Axon components and register all your message handling functions (Command, Event and Query handlers) which are tied to Spring beans.
  3. If you're on a regular Spring application, you can use the @EnableAxon annotation on a configuration class. That annotation will automatically create all the required Axon beans and wire all your Command/Event/Query handlers.

Hope this helps you out!

Upvotes: 1

Related Questions