+dropwizard-user, dropwizard-dev to bcc Hello Jay,
Which fields are you referring to, exactly? I think what Ryan was suggesting is to put an Optional<DataSourceFactory> in your applications' configuration classes. If the optional is present, then the DataSourceFactory can be initialized and integrated in the app. Otherwise, it's ignored, and the app continues along in a database-less state. I've used this technique in the past with services that can optionally include a Redis caching layer. Subclasses of io.dropwizard.Configuration can have optional fields and these fields will be properly populated based on the presence or absence of the corresponding parameters in the YAML config file. On Mon, Sep 25, 2017 at 10:54 AM, Ryan Kennedy <[email protected]> wrote: > Not sure I follow. Any chance you can share your Configuration class > (redacted/fuzzed would be fine)? > > On Mon, Sep 25, 2017 at 10:27 AM Jay Goldberg <[email protected]> wrote: > >> Those fields are predefined and are not optional >> >> On Mon, Sep 25, 2017 at 11:38 AM, Ryan Kennedy <[email protected]> >> wrote: >> >>> Can you not set the database configuration as optional and only set up >>> the database bits when one is present? >>> >>> On Mon, Sep 25, 2017 at 8:35 AM Jay Goldberg <[email protected]> wrote: >>> >>>> I have two services which I wish to merge. One has a database >>>> dependency and the other does not. If I wish to merge these services and >>>> only wish to enable the non-database dependent service it still requires me >>>> to configure a database. >>>> Is there a way to allow dropwizard not to have to have a database when >>>> not needed? >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "dropwizard-dev" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> -- >>> You received this message because you are subscribed to a topic in the >>> Google Groups "dropwizard-dev" group. >>> To unsubscribe from this topic, visit https://groups.google.com/d/ >>> topic/dropwizard-dev/eB9Dua4JGzc/unsubscribe. >>> To unsubscribe from this group and all its topics, send an email to >>> [email protected]. >> >> >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "dropwizard-dev" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> For more options, visit https://groups.google.com/d/optout. >> > -- > You received this message because you are subscribed to the Google Groups > "dropwizard-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- Evan Meagher <https://evanmeagher.net/> -- You received this message because you are subscribed to the Google Groups "dropwizard-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
