GithubHelp home page GithubHelp logo

ff4j / ff4j-spring-boot-starter-parent Goto Github PK

View Code? Open in Web Editor NEW
31.0 5.0 26.0 1.07 MB

A spring boot starter for FF4J (Feature Flipping For Java)

License: Apache License 2.0

Gherkin 33.72% Kotlin 66.28%
ff4j spring springboot flipper flipping kotlin-language

ff4j-spring-boot-starter-parent's Introduction

Spring boot starter for FF4J (Feature Flipping for Java)

Build Status Codacy Badge codecov License Apache2 Join the chat at https://gitter.im/paul58914080/ff4j-spring-boot-starter-parent

Feature Flipping For Java Spring boot

This project aims in providing bootable starters with RESTful apis for FF4J. We provide 2 starters, one for webmvc and another for webflux.

ff4j-spring-boot-starter-webmvc

This starter is aimed to facilitate the use FF4J with spring boot webmvc. It provides the following features:

  • Webapi's for FF4J
  • OpenApi documentation for FF4J
  • Web-console for FF4J

You can add the following dependency in your project to use this starter

<dependency>
  <groupId>org.ff4j</groupId>
  <artifactId>ff4j-spring-boot-starter-webmvc</artifactId>
  <version>2.0.0</version>
</dependency>

A sample project is located at ff4j-spring-boot-starter-webmvc-sample

ff4j-spring-boot-starter-webflux

Disclaimer: This starter is still in beta. Please use it with caution. Please note this is not fully supported but to lay a foundation for the future.

This starter is aimed to facilitate the use FF4J with spring boot webflux. It provides the following features:

  • Webapi's for FF4J
  • OpenApi documentation for FF4J

You can add the following dependency in your project to use this starter

<dependency>
  <groupId>org.ff4j</groupId>
  <artifactId>ff4j-spring-boot-starter-webflux</artifactId>
  <version>2.0.0</version>
</dependency>

A sample project is located at ff4j-spring-boot-starter-webflux-sample

About older version(version 1.x)

Please refer branch 1.x for the older version. We will have limited support on 1.x version. We suggest you to move to the latest version.

What is FF4J ?

FF4J is a proposition of Feature Toggle. Features can be enabled or disabled through configuration at runtime with dedicated consoles, Web API, or monitor features usage. The same web console can also define any Property and change its value at runtime.

More information can be found at ff4j.org or the reference guide. To access a demo please click [here] (http://cannys.com/ff4j-demo)

ff4j-spring-boot-starter-parent's People

Contributors

alexandrenavarro avatar anupbaranwal avatar clun avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar derekroy avatar form-in-code avatar gitter-badger avatar paul58914080 avatar serioussem avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ff4j-spring-boot-starter-parent's Issues

Setup starter with optional keys in application.yaml

Is your feature request related to a problem? Please describe.
When you importing the spring-boot-starter in your application you may asking yourself what are the beans you should create and which ones are already available. As far as I understand:

  • you need to define ff4j
  • you need to define and expose the web console if you want it (FF4jDispatcherServlet)
  • The rest Api is always there but you can enable the swagger doc with a an annotation.

Describe the solution you'd like
What about creating dedicated keys in the application.yaml for ff4j enabling or disabling some beans. Also we can secure the web-console with login/password out of the box with spring security. This is what it look like :

ff4j:
  webconsole:
    enable: true
    url: /ff4j-web-console
    secure: true
    username: admin
    password: ff4j
  rest-api:
    enable: true 
    url: /api/ff4j
    secure: true
    username: admin
    password: ff4j

I have created a working sample for the web-console part here

I also IMO module ff4j-web should be a dependency of the starter. You can still exclude if you don't want it but must of people using the starter what the we console.

With that perspective, only the ff4j bean is required in your app everything else is configuration. FF4j is such a complex object with different stores and properties that for now i don't see it yaml but later what about a constructor with a yaml in the ff4j object.

spring boot 2.0.1 migration issue.

After migrating to spring boot 2.0.1 version, i started getting below error

Caused by: java.io.FileNotFoundException: class path resource [org/springframework/boot/web/support/SpringBootServletInitializer.class] cannot be opened because it does not exist

upon checking the issue could be because of wrong import in FF4JWebConfiguration for SpringBootServletInitializer

Is there a version of ff4j compatible with spring boot 2.0.1 I am using latest ff4j version 1.7.1

ff4j-store-redis to support Jedis 3.1.0

I am using spring boot version. - 2.2.1.RELEASE. application uses redis as a database so I have dependency on org.springframework.data -> spring-data-redis with version 2.2.1.RELEASE which uses Jedis 3.1.0 version otherwise it fails to make a Jedis connection.

Now my application has a dependency on ff4j-store-redis which has a latest version 1.8.2 and can use Jedis 2.10.0 not the 3.1.0 hence, I am unable to use ff4j-store-redis with spring boot 2.2.1.RELEASE.

ERROR -

Caused by: java.lang.ClassNotFoundException: redis.clients.util.Pool

banner displaying the old version

Describe the bug
Wrong ff4j version. When the application boots it displays the version used is 1.7.3 whereas the version is 1.8

To Reproduce
Add the ff4j-spring-boot-starter version 1.8 dependency and boot your application when the application boots you can observe the incorrect version on the text even though the right version is being used

Expected behaviour
The banner should display 1.8 version (the current version that is being used)

Add a Rest API for check multiple toggles in one call

Is your feature request related to a problem? Please describe.
Today, in our client application, we have to check 43 toggles at startup, it costs to call one by one notably because some our users are not closed to the servers, the latency is not so good (not in the same region/continent sometimes). So we want to have on call for n feature toggles.

Describe the solution you'd like
Add a Api in FF4jResource like

@ApiOperation(value = "Check feature toggles", response = Map::class)
@ApiResponses(
        ApiResponse(code = 200, message = "Map of featureUId/flipped"),
        ApiResponse(code = 400, message = "Invalid parameter"))
@PostMapping(value = [("/$OPERATION_CHECK")])
fun check(@RequestBody featureUIDs: List<String>): ResponseEntity<Map<String,Boolean>> {
    val featureUIDToEnableMap = HashMap<String, Boolean>()
    for (featureUID in featureUIDs) {
        val status = ff4JServices.check(featureUID)
        featureUIDToEnableMap[featureUID] = status
    }
    return ResponseEntity(featureUIDToEnableMap, OK)
}

See my sample fork https://github.com/alexandrenavarro/ff4j-spring-boot-starter-parent/blob/master/ff4j-spring-boot-web-api/src/main/kotlin/org/ff4j/spring/boot/web/api/resources/FF4jResource.kt

Tell me if you are ok with the API added.

Describe alternatives you've considered
I'm not sure if you prefer to have a POST with requestBody with a list inside or wrapper with a list inside in case we want to add some parameter in the future (as you prefer).
We can do also a get with the list as requestParamater but I don't think it is good solution because the size of url is limited and we will have errors when the number of featureUid will be to important.

Additional context
Add any other context or screenshots about the feature request here.

I also created a issue in ff4j for the equivalent ff4j/ff4j#449

conflict with swagger and activiti

hi paul,
when I integrate this compont, it gets:
Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'swaggerConfig' for bean class [org.ff4j.spring.boot.web.api.config.SwaggerConfig] conflicts with existing, non-compatible bean definition of same name and class [com.phoenix.common.swagger.SwaggerConfig]

but after I remove com.phoenix.common.swagger.SwaggerConfig, but it gets,
Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'groupResource' for bean class [org.ff4j.spring.boot.web.api.resources.GroupResource] conflicts with existing, non-compatible bean definition of same name and class [org.activiti.rest.service.api.identity.GroupResource]

could you tell me how to fix it? thanks

turn ff4j swagger on or off by configuration property

hi @paul58914080 ,

I found there is a Swagger config in ff4j-spring-boot-web-api component which will be included in ff4j-spring-boot-starter component. If an application that has a Swagger config depends on ff4j-spring-boot-starter component, the application cannot run normally. So, It is recommended that configuration properties be provided, The user decides whether to turn ff4j swagger on or off by the configuration property.

Looking forward to your reply

Would you please remove banner for ff4j

I don't think that it is adding the banner of ff4j to custmon service side is a good idea, sometime people prefer to see the spring boot version with origin spring boot banner. Or you can add a config just like 'ff4j.banner.enabled=false' to close the banner. Thanks very much!

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.