Git Product home page Git Product logo

Comments (3)

michaeldejong avatar michaeldejong commented on August 12, 2024

Hi @GarciaPL!

This is already possible by either:

  1. Using the builder: builder.withConsulHost("http://localhost:8501") or builder.withConsulHost("localhost:8501").
  2. Or using ENV variables: CONSUL_HOST=http://localhost:8501 or CONSUL_HOST=localhost:8501.

from consultant.

GarciaPL avatar GarciaPL commented on August 12, 2024

Hi,

thank you for reply. Yes it works ;) Moreover I was trying to fetch properties from consul which are stored at this moment in directories like dev, qa but invoking getProperties() method returns empty Properties object. Do you have any idea what might be missing ?

from consultant.

michaeldejong avatar michaeldejong commented on August 12, 2024

Ah yes currently Consultant only supports one way of storing/retrieving settings. It only reads/listens to config defined in a particular folder in the root folder, which has to be named after the service name. So if I have a builder like this:

Consultant.builder()
        .identifyAs("some-service")
        .build();

Then the config for that service must be placed in a folder called "some-service". We currently don't have a way of conditionally loading settings depending the environment (qa, dev, etc). However it's probably not a good idea anyway to store all of those settings in the same Consul cluster. Instead what we do (which may also be of use to you) is to have separate clusters, each dedicated to their own environment, and containing settings specific to that setting. For development we run Consul in a VM locally, which we also register our services to, so we don't interfere with production or each other.

from consultant.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.