Giter VIP home page Giter VIP logo

Comments (4)

bwoskow-ld avatar bwoskow-ld commented on May 20, 2024

Hi zacyang,

Thanks for the suggestion. This is a low priority at the moment since we don't believe this feature request to be something that would be generally useful to most customers, but we'll keep this issue for future consideration.

Ben

from java-server-sdk.

eli-darkly avatar eli-darkly commented on May 20, 2024

It'd be easier to determine the best approach to this if the use case was clearer. This is something that could only be done when you have a live connection to LaunchDarkly - so, when you say "I needed a test", do you mean you would have a unit test or integration test that would actually connect to LD? Generally speaking it's not advisable to have CI tests like this rely on an external service. Or would this be something that is used in production by your application?

It sounds like whichever context you want this in, you are already doing it now via your REST workaround so I'm sure you're already aware of the tradeoffs, but I'd just like to understand the intended usage better.

from java-server-sdk.

zacyang avatar zacyang commented on May 20, 2024

@eli-darkly , thanks for getting back to me.

Yes, we used a live connection to live LD in CI. Reason for this is, we have some feature switch based on variant. The value in the variants determine the behaviours of some particular actions,
e.g ["db", "kafka"] means event A need to be save to both database and publish to kafka.

This is critical for us to guarantee the semantics (exactly once) of the events, therefor I need some test to make sure the variants are what we think it is before deploying to prod.

And you are right, I've implemented the test based on the rest api you guys provided, just thought it would be nicer to have it thru client.

from java-server-sdk.

bwoskow-ld avatar bwoskow-ld commented on May 20, 2024

Hi @zacyang ,

After re-reading this ticket, I realize that we had a solution for you all along. We maintain a set of client libraries for interacting with LaunchDarkly's REST API. These clients are auto-generated from our OpenAPI spec. Most relevant here is api-client-java.

Once you add api-client-java to your application you can use FeatureFlagsApi#getFeatureFlag(string) to get your flag and then call getVariations on the flag to get all possible variations. This is our recommended approach for doing so programmatically through a LaunchDarkly-provided client library.

The reason for maintaining API client libraries separate from our SDKs (java-server-sdk and others) is to allow our SDKs to be as lightweight as possible. We generally only add functionality to the SDKs when the functionality is common and/or crucial to the flow of evaluating flag rulesets on behalf of users, sending events back to LaunchDarkly, and so forth. All other functionality should be accessed through our REST APIs by our auto-generated API client libraries.

I'm going to close this ticket now. Cheers,
Ben

from java-server-sdk.

Related Issues (20)

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.