-
Notifications
You must be signed in to change notification settings - Fork 32
[FSSDK-11455] Java - Add SDK Multi-Region Support for Data Hosting #573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds multi-region support for data hosting in the Optimizely Java SDK by introducing region-specific event endpoints. The implementation allows the SDK to route events to appropriate regional endpoints (US or EU) based on the project configuration.
Key changes:
- Added a Region enum to ProjectConfig with US and EU values
- Created EventEndpoints utility class to map regions to specific event endpoint URLs
- Updated all parsers and constructors to handle the new region field from datafiles
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
core-api/src/main/java/com/optimizely/ab/config/ProjectConfig.java | Added Region enum with US and EU values and getRegion() method |
core-api/src/main/java/com/optimizely/ab/config/DatafileProjectConfig.java | Added region field and updated constructors to support region parameter |
core-api/src/main/java/com/optimizely/ab/event/internal/EventEndpoints.java | New utility class providing region-specific endpoint mapping |
core-api/src/main/java/com/optimizely/ab/event/internal/EventFactory.java | Updated to use region-specific endpoints instead of hardcoded URL |
core-api/src/main/java/com/optimizely/ab/config/parser/*.java | Updated all parsers to extract region from datafile with US as default |
core-api/src/test/java/**/*.java | Updated test files to accommodate new region parameter and validate endpoint behavior |
core-api/src/main/java/com/optimizely/ab/config/parser/DatafileJacksonDeserializer.java
Outdated
Show resolved
Hide resolved
core-api/src/main/java/com/optimizely/ab/config/parser/DatafileGsonDeserializer.java
Outdated
Show resolved
Hide resolved
core-api/src/main/java/com/optimizely/ab/event/internal/EventEndpoints.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. string-type region will make it much easier and safer when we add more countries in the server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few changes suggested
core-api/src/main/java/com/optimizely/ab/config/DatafileProjectConfig.java
Outdated
Show resolved
Hide resolved
core-api/src/main/java/com/optimizely/ab/config/DatafileProjectConfig.java
Outdated
Show resolved
Hide resolved
core-api/src/main/java/com/optimizely/ab/config/DatafileProjectConfig.java
Outdated
Show resolved
Hide resolved
core-api/src/main/java/com/optimizely/ab/config/ProjectConfig.java
Outdated
Show resolved
Hide resolved
core-api/src/main/java/com/optimizely/ab/config/parser/JsonConfigParser.java
Outdated
Show resolved
Hide resolved
core-api/src/main/java/com/optimizely/ab/config/parser/JsonSimpleConfigParser.java
Outdated
Show resolved
Hide resolved
core-api/src/main/java/com/optimizely/ab/event/internal/EventEndpoints.java
Outdated
Show resolved
Hide resolved
core-api/src/main/java/com/optimizely/ab/event/internal/EventEndpoints.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary
Test plan
Issues