Dropwizard: Application is still running after a EnvironmentCommand is being finished

97 views
Skip to first unread message

Feng Lei

unread,
Aug 10, 2021, 5:17:09 AM8/10/21
to dropwizard-dev
Hi Dropwizard,

My custom command is named migrate which is EnvironmentCommand type. 
It is just a plain command that does a job only once so it doesn't need Jersey.
It works fine but the problem is at the end of the job I expect the Java application should stop automatically. But no, the application was still in a running state and no phenomenons show it will stop later. 

It is a bit weird, do you guys know why that happens? It is something related to the Dropwizard lifecycle?

Jochen Schalanda

unread,
Aug 10, 2021, 7:08:53 AM8/10/21
to dropwiz...@googlegroups.com
Hi,

take a look at how the commands for dropwizard-migrations (using Liquibase) are being implemented:

https://github.com/dropwizard/dropwizard/blob/v2.0.24/dropwizard-migrations/src/main/java/io/dropwizard/migrations/AbstractLiquibaseCommand.java#L23

As mentioned in your previous thread, ConfiguredCommand won't start Jetty, but EnvironmentCommand will do this.

Cheers,
Jochen

--
You received this message because you are subscribed to the Google Groups "dropwizard-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dropwizard-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dropwizard-dev/976a100b-afd6-407b-9483-9dc53867aec4n%40googlegroups.com.

Feng Lei

unread,
Aug 12, 2021, 10:48:06 PM8/12/21
to dropwizard-dev
Oh, yes. Got it.  Like the ServerCommand, it is an EnvironmentCommand. 
Reply all
Reply to author
Forward
0 new messages