I suppose you can use a DropWizard's Jersey Client. According to the documentation, it does exactly what you are looking for.
http://www.dropwizard.io/1.0.3/docs/manual/client.html
I.e.:
public class ExampleConfiguration extends Configuration {
@Valid
@NotNull
private JerseyClientConfiguration jerseyClient = new JerseyClientConfiguration();
@JsonProperty("jerseyClient")
public JerseyClientConfiguration getJerseyClientConfiguration() {
return jerseyClient;
}
}
Then, in your service’s run method, create a new JerseyClientBuilder:
@Override
public void run(ExampleConfiguration config,
Environment environment) {
final Client client = new JerseyClientBuilder(environment).using(config.getJerseyClientConfiguration())
.build(getName());
environment.jersey().register(new ExternalServiceResource(client));
}