How to register / add a command to dropwizard

I am trying to use dropwizard functionality

http://dropwizard.codahale.com/manual/core/#commands

I wrote a class that extends from ConfiguredCommand, and I want to add / register it to the dropwizard service / environment. I cannot learn how to add / run a new command from dropwizard.

+2
source share
1 answer

com.yammer.dropwizard.config.Bootstrap contains the addCommand method to add ConfiguredCommand . You will gain access to this object by overriding the initialization method in your service class, for example.

 public void initialize (Bootstrap<T> configurationBootstrap) { configurationBootstrap.addCommand(yourCommand); } 
+2
source

Source: https://habr.com/ru/post/1237513/


All Articles