Keep alive Aggregate only micorservice

Hi! I’m trying to decompose at minimal granularity a complex axon project.
I have this problem, I have created a single aggregate microservice:

  • SpringBootApplication
  • AggregateClass

But after the startup the application starts the shutdown.
This not happen with a Projection Service (EventHandler)

Any ideas?

This is probably because Spring Boot thinks your application is a command lines application, rather than a Web Application.

Since most projects will have some form of actuator endpoint, including Spring-Boot-Starter-Web is most likely the easiest way to force Spring Boot to keep the app running.

1 Like

i’ll try with actuator, thx,
but why it works with EventHandler Services? (Like projections)

I’m actually not sure.

It might be because the Event Processors create a Thread Pool that keeps the application running while it’s active. Maybe the thread pools used by gRPC (which handle the commands and queries) are configured to use daemon threads. Those will not prevent a shutdown from happening.

1 Like