Search code examples
javarestportdropwizardjetty-8

Disable adminconnectors in Dropwizard config.yml


I do not need the adminConnectors. Is there a way I can turn it off in my config file? If I comment out the lines, it uses a default port number and fails (because something else is using the default port: 8081), I do not want that to happen.


Solution

  • Edit: This answer is not longer accurate. If you just want to disable the admin connectors, see the linked question down in the comments. If you need more subtle changes in the behaviour you will need to implement your own ServerFactory. Use the SimpleServerFactory of DefaultServerFactory as a template/guideline.

    In dropwizard source there is: SimpleServerFactory. You can switch to this implementation by setting the following in the .yml file:

    server:
      type: simple
    

    The documentation is available here. If this doesn't suit your needs you will have to implement your own ServerFactory.