Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

141
Visualizações
Dropwizard command line input

We have been using Dropwizard to create HTTP service. Usually the syntax would look like

java -jar {path_to_jar} server config.yml

This spins of HTTP server internally using ServerCommand of dropwizard. But, as for the new requirement we need it to support another command line input preferrably the first input of the run. Say,

java -jar {path_to_jar} path_to_file server config.yml
                    (or at least)
java -jar {path_to_jar} server config.yml path_to_file

I know dropwizard supports custom command input like

  java -jar {path_to_jar} hello -u world

The trick here is we need to support command input along with HTTP server, the documents fails to address this requirement. Is it even possible with dropwizard?.

Note: Adding this parameter to config.yml is not an option. As this parameter is supplied from outside to which we don't want to expose our yml file.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Since you have full control over the public void static main(String[] args) method, you can do whatever additional processing you want there and pass it to the application.

Before you go down that route however, can your requirement be addressed using environmental variables in the config file? http://www.dropwizard.io/1.1.0/docs/manual/core.html#environment-variables

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda