springdockeraxon

How to start Docker Axon server in development mode


I'm new to Axon and Docker and I would like to start axon server in Docker using developmnent mode in order to clear events as I'm in the process of building a system and my events and commands change often.

I read on Axon documentation that a certain property axoniq.axonserver.devmode.enabled (defaults to false) has to be set. I also know that Axon uses spring boot, so I guess I would need to somehow access the axonserver.properties on Docker, but here is the problem, i don't know how.

I would be thankful if anyone could explain how to change this configuration.


Solution

  • Fortunatelly Axon has been publishing blogs about running axon-server and one of them, they teach how to run it on docker =)

    Blog post: https://axoniq.io/blog-overview/running-axon-server-in-docker

    The important part, in your case, is here:

    A third directory, not marked as a volume in the image, is important for our case: If you put an “axonserver.properties” file in “/config”, it can override the settings above and add new ones:

    Which means, you can create your axonserver.properties in this directory with the desired property (axoniq.axonserver.devmode.enabled=true) and it will pick it up from there!

    On the other hand, you can also set the environment variable: AXONIQ_AXONSERVER_DEVMODE_ENABLED to true.

    Hope it helps.