A Spring Boot REST API demonstrating Confidence feature flags with subscription plan management and regional filtering.
- Java 21 or higher
- Maven 3.6 or higher
-
Clone and navigate to the project
cd java -
Build the project
mvn clean compile
-
Run the application
mvn spring-boot:run
The API will start on http://localhost:8080
Returns subscription plans with optional region filtering and feature flag evaluation.
Query Parameters:
region(optional) - Filter by region:na,eu,ap,sa,af
Headers:
X-VISITOR-ID(optional) - Visitor identifier for feature flag targeting
Examples:
# Get all plans
curl http://localhost:8080/plans
# Get plans for specific region
curl http://localhost:8080/plans?region=eu
# Get plans with visitor targeting
curl -H "X-VISITOR-ID: $(uuidgen)" http://localhost:8080/plans?region=naControls whether the Enterprise plan is displayed to users.
Schema:
{
"enabled": boolean,
"price": string (optional)
}Purpose: Dynamically show/hide the Enterprise plan and customize its pricing based on visitor context and region.
- Framework: Spring Boot 3.2.0
- Build Tool: Maven
- Feature Flags: Confidence SDK via OpenFeature
- Dependency Injection: Spring IoC container
- Data: In-memory mock data with regional distribution
- OpenFeature Integration: Singleton client with startup initialization
- Regional Data Model: Plans support multiple regions via List
- Context Evaluation: Visitor ID and region-based feature flag targeting
- REST API: Clean endpoint design with optional query parameters