-
Notifications
You must be signed in to change notification settings - Fork 614
Add custom URL path configuration for load balancer routing #2689
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
base: main
Are you sure you want to change the base?
Conversation
|
|
- Added CUSTOM_URL_PATH property to ClientConfigProperties - Added customURLPath() builder method to Client.Builder - Modified HttpAPIClientHelper.executeRequest to append custom path to URLs - Added comprehensive unit tests for the new feature - All tests passing Co-authored-by: chernser <[email protected]>
- Extracted common URL building logic into helper method - Improved code maintainability by reducing duplication - Clarified documentation for customURLPath parameter Co-authored-by: chernser <[email protected]>
- Created detailed usage guide with examples - Documented various scenarios and use cases - Added load balancer configuration example - Included compatibility information Co-authored-by: chernser <[email protected]>
|
@copilot Please sign CLA. Thanks! |
|
@copilot |
|
@copilot |
- Rewrote tests to exercise actual production code - Tests now call Client.Builder.customURLPath() method - Tests verify ClientConfigProperties.CUSTOM_URL_PATH configuration - Tests check configuration parsing and various path formats - Removed integration tests that required running server - All tests are unit tests that exercise the production code directly Co-authored-by: chernser <[email protected]>
The tests were checking for exactly 32 configuration properties, but the new CUSTOM_URL_PATH property increased the count to 33. Updated both testDefaultSettings and testWithOldDefaults assertions. Co-authored-by: chernser <[email protected]>
|
|
@copilot |
The test at line 257 calls useTimeZone() which adds an extra configuration property (USE_TIMEZONE), so it has one more property than the other tests. Updated the assertion to expect 34 instead of 33. Co-authored-by: chernser <[email protected]>


Summary
Enables routing to different ClickHouse instances behind a load balancer by configuring custom URL paths (e.g.,
/sales/db,/app/db). Database selection remains viaX-ClickHouse-Databaseheader.Changes
ClientConfigProperties: AddedCUSTOM_URL_PATHproperty (String, default: "")Client.Builder: AddedcustomURLPath(String)method for fluent configurationHttpAPIClientHelper.executeRequest(): Appends custom path to base URL viaURIBuilder, handles path concatenationClient.Builder.customURLPath()method,ClientConfigProperties.CUSTOM_URL_PATHconfiguration, and configuration parsing with various path formatsClientTeststo account for the newCUSTOM_URL_PATHproperty:useTimeZone()which adds an additional property)Example
Checklist
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.