A namespace provides a working environment for a plug-in, application, or microservice. It provides threads, registers targets, and has a local nano service registry. It encapsulates this environment from other namespaces so that, for example, hundreds of instances of the same application can operate simultaneously in the same node.

A number of namespaces are always registered in a node. However, the initialization of all packages is asynchronous. So it can happen that the own package is initialized, but the namespace is not available yet. So it is advisable to add needed namespaces to the dependencies of your own service starter. This ensures that the required namespaces are available when the own package is initialized.

Get an existing namespace

A namespace is fetched from the service registry. The namespace ID (in the example "SYSTEM") is passed as property.

final INamespace ns = CServiceRegistry.getInstance()

Create an additional namespace thread

You can add another thread to the namespace. When registering targets in the target registry, the queue ID in which the target is to operate can then be specified. The priority can be selected between EThreadPriority.LOWEST (1) and EThreadPriority.HIGHEST (10).

@NotNull IId createThread(@NotNull String aName,
                          @NotNull final EThreadPriority aPriority) throws CException;


Fetch the namespace ID.

IId getNID();

Fetch the node address.

@NotNull CNodeAddress getNodeAddress();

Fetch the namespace address.

@NotNull CNamespaceAddress getAddress();

Get a description.

@NotNull String getDescription();

Get the target registry. All targets of the namespace are registered in the target registry.

@NotNull ITargetRegistry getTargetRegistry();

Get the nano service registry. All local nano services are registered in the nano service registry.

@NotNull INanoServiceRegistry getNanoServiceRegistry();

Get the message queue registry. All threads belonging to the namespace are created in this registry.

@NotNull IMessageQueueRegistry getMessageQueueRegistry();

IDs and addresses

A given namespace ID can be checked to see if it matches its own local namespace ID. In this case, a null value or an empty ID is considered local.

boolean isLocal(@Nullable IId aNID);

A given namespace address can be checked to see if it matches the local address. A namespace address is local if the namespace ID is equal to or empty. In addition, the node ID and segment ID must also be local or empty.

boolean isLocal(@NotNull CNamespaceAddress aAddress);


This method tells you the number of messages already processed in this namespace.

long getMessageCountHandled(); - Innovative Distributed System