AxonServer 2025.0.x not picking up configuration properties from file or env

Hi, I’m using AxonServer 2025.0.x (tried 1 and 2), in a Docker Compose environment with a mounted axonserver.properties file. In that file, I added the following properties (for development and testing purposes):

axoniq.axonserver.standalone=true
axoniq.axonserver.event.segment-size=10MB
axoniq.axonserver.snapshot.segment-size=10MB
event.retention-time=5m
snapshot.retention-time=5m
experimental.black-hole.conditional-remove=1

However, the last 3 properties are not picked up by Axon server. I don’t see it reflected in the configdb and not returned via the /v1/public/context API. Only when I add those properties to the default context via the UI, they are applied.

I even prefixed the properties with axoniq.axonserver.contexts.default to apply them to the default context, but it’s not working.

Did I miss something from the documentation or is this a bug?

Additional info:

  • just running a plain java -jar axonserver.jar (without Docker) shows the same
  • segment sizes ARE picked up, as the file sizes decrease from the standard 512M to the specified 10M, but the properties are not reflected in the context properties in the UI

The last three properties you list here are the names of the properties as they can be set on a context level. You cannot configure those at a global level.

Is there a way to set context level properties on initial startup of the AxonServer?

The only way for this is to use a cluster-template. Here you can define the properties for the context to be created. You can use a cluster template instead of the axoniq.axonserver.standalone=true option. For more information see:
Cluster template in the documentation.
For your case, where you are running with one node in docker the following would be the setup:

axoniq:
  axonserver:
    cluster-template:
      first: localhost:8224
      replicationGroups:
      - name: _admin
        roles:
        - node: axon-server
          role: PRIMARY
        contexts:
        - name: _admin
      - name: default
        roles:
        - node: admin-server
          role: PRIMARY
        contexts:
        - name: default
          metaData:
            event.tier.1.primary: black_hole
            experimental.black-hole.conditional-remove: "1"
            event.tier.primary: default
            event.storage.primary: primary
            snapshot.storage.primary: primary
            snapshot.tier.primary: default
            snapshot.retention-time.1.primary: PT10M
            event.index-format: JUMP_SKIP_INDEX
            snapshot.tier.1.primary: black_hole
            event.retention-time.1.primary: PT10M
            snapshot.index-format: JUMP_SKIP_INDEX

For this to work, you need to add the following properties:

axoniq.axonserver.internal-server-name=localhost
axoniq.axonserver.name=axon-server
axoniq.axonserver.clustertemplate.path=<location of the cluster template file>

Thanks for the hint to cluster-templates. Unfortunately, the sample you provided is not working out of the box, but I was able to export the template of a configured single node cluster. Now I can start a fresh one with that. Problem solved. Thanks!

It appears AxonServer 2025.0.x doesn’t honor context-specific properties like event.retention-time, snapshot.retention-time, or any experimental flags (e.g., experimental.black-hole.conditional-remove) prefixed with axoniq.axonserver.contexts.default from the axonserver.properties file. These configuration types are applied by the configuration database (configdb) and need to be explicitly configured in the AxonServer UI or REST API to become active. This appears more intentional than a bug as some class of dynamic or context level properties do not get read from flat files when the server starts. If you want a configuration that is automated after the server has started, consider to script the context configuration with the API.