ef-labs / vertx-jersey

Run jersey in vert.x
MIT License
150 stars 47 forks source link

How to register a Feature in JerseyVerticle? #59

Closed yingqiaomxi closed 7 years ago

yingqiaomxi commented 7 years ago

In Jersey, we may use ResourceConfig to register a Feature.class. I wonder how I can do that in a vertx-jersey application?

adrianluisgonzalez commented 7 years ago

Two options:

  1. Via configuration components - An array of components class names to inject (features, etc.). For example: org.glassfish.jersey.jackson.JacksonFeature.
  2. Programmatically by injecting an ApplicationConfigurator
yingqiaomxi commented 7 years ago

I see. How can I configure the properties of a Feature by using this "components" field? For example, for a LoggingFeature, I may need to set up the logging level. How can I do that?

Many thanks!

adrianluisgonzalez commented 7 years ago

Read through the rest of the configuration section in the README. I think what you are looking for is properties properties - An object with additional properties to be set on the ResourceConfig

https://github.com/jersey/jersey/blob/master/core-common/src/main/java/org/glassfish/jersey/logging/LoggingFeature.java#L265

yingqiaomxi commented 7 years ago

Yes, this is helpful!