IdentifierFactoryto generate all identifiers, whether they are for events, commands or queries. The default
IdentifierFactoryuses randomly generated
java.util.UUIDbased identifiers. Although they are very safe to use, the process to generate them does not excel in performance.
IdentifierFactoryis an abstract factory that uses Java's
ServiceLoader(since Java 6) mechanism to find the implementation to use. This means you can create your own implementation of the factory and put the name of the implementation in a file called
ServiceLoadermechanism will detect that file and attempt to create an instance of the class named inside.
IdentifierFactory. The implementation must:
/META-INF/services/org.axonframework.common.IdentifierFactoryfile on the classpath,
IdentifierFactoryclass, and must