Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Dropwizard default ports

I have a Dropwizard based Jersey REST service running on the default ports 8080(service) and 8081(admin), I need to change the default ports to something that is less commonly used, I am not able to find any information to do so , can someone please point me to do so ?

like image 560
user1965449 Avatar asked Nov 17 '13 07:11

user1965449


People also ask

How do I change the Dropwizard port?

Add your configuration to the command line after server . See dropwizard.codahale.com/getting-started/#running-your-service for more information. It should have the desired effect. Perfect!

What is Dropwizard configuration?

Dropwizard is an open-source Java framework used for the fast development of high-performance RESTful web services. It gathers some popular libraries to create the light-weight package. The main libraries that it uses are Jetty, Jersey, Jackson, JUnit, and Guava. Furthermore, it uses its own library called Metrics.

Does Dropwizard use Log4j?

Dropwizard uses Logback for its logging backend. It provides an slf4j implementation, and even routes all java. util. logging , Log4j, and Apache Commons Logging usage through Logback.

Does Dropwizard use Jetty?

Jetty for HTTP Because you can't be a web application without HTTP, Dropwizard uses the Jetty HTTP library to embed an incredibly tuned HTTP server directly into your project.


1 Answers

You can update the ports in your yaml configuration file:

http:   port: 9000   adminPort: 9001 

See http://www.dropwizard.io/0.9.2/docs/manual/configuration.html#http for more information.

EDIT

If you've migrated to Dropwizard 0.7.x, 0.8.x, 0.9.x you can use the following:

server:   applicationConnectors:   - type: http      port: 9000   adminConnectors:   - type: http     port: 9001 
like image 122
condit Avatar answered Sep 30 '22 19:09

condit