Is it possible to start the Axon server embedded in my spring-boot application?

Davi :

According to the Axon documentation, the Axon server could be run from the command line or deployed in a docker container. I was wondering if it would be possible/recommended to start it directly from my spring-boot application, by manually instantiating the server class.

Could you guys please share your experience with it?

Obs: For security reasons, I am not allowed to start the Axon server in our production server unless it were packed together with our application.

Steven :

At the moment, Axon Server cannot run in an 'embedded' form like you're asking, @Davi. Thus, for Axon Server version 4.1.x, this isn't an option.

It is obviously not ruled out that this might chance in the future, as it is definitely not a weird thing to ask. Prioritization on this feature has not taken place yet, but requests of interest like you've done right now might chance that. I'd suggest following the AxonIQ mail notifications on this part, as once this will be introduced I am pretty certain it'll be shared through those channels.

Additionaly, like @Mzzl is sharing, Axon Server is not a hard requirement to running an Axon Framework application. It's the preferred format as it provides a dedicated solution for routing commands, events and queries, as well as a purpose build Event Store which in the long run is far more suitable to store events then a regular RDBMS approach.

However, if this is not the way to go within your application, or differently put, you want to configure the routing and storage of those messages yourself, than it is perfectly fine to exclude the connection to server by excluding the axon-server-connector dependency.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=133705&siteId=1