Annotation Interface Namespace
Annotation used to declare the namespace (or bounded context) of a class, package, or module.
The namespace value is used, for example, to derive the QualifiedName.namespace() field when a
QualifiedName is constructed by annotation-resolving components. Because this annotation can be applied to
packages and modules, it provides a single location to configure the namespace for many classes at once.
This is particularly useful when messages within a package or module share the same
namespace. As such, this annotation acts as a catch-all alternative to the type-specific Command.namespace(),
Event.namespace(), and Query.namespace() annotations.
Example usage on a class:
@Namespace("university")
public record SubscribeStudentToCourse(...) { }
Example usage on a package (in package-info.java):
@Namespace("university")
package org.axonframework.examples.university;
import org.axonframework.messaging.core.annotation.Namespace;
- Since:
- 5.1.0
- Author:
- Steven van Beelen
- See Also:
-
Optional Element Summary
Optional Elements
-
Element Details
-
value
String valueThe namespace (or bounded context) defined by this annotation.- Returns:
- the namespace (or bounded context) defined by this annotation
- Default:
""
-