Skip to content

6.X: add support for custom HttpClient configurations in JWK#2644

Closed
christiangoerdes wants to merge 23 commits into
masterfrom
jwk-http-config-6x
Closed

6.X: add support for custom HttpClient configurations in JWK#2644
christiangoerdes wants to merge 23 commits into
masterfrom
jwk-http-config-6x

Conversation

@christiangoerdes
Copy link
Copy Markdown
Collaborator

@christiangoerdes christiangoerdes commented Jan 20, 2026

Summary by CodeRabbit

  • New Features

    • Added node status tracking for load-balanced destinations with per-destination status codes and exception logging.
    • Implemented dual-mode health monitoring for load balancer nodes: HTTP health check (when configured) or TCP fallback.
    • Enhanced JSON-to-XML conversion with configurable element naming (root, array, item).
    • Added JSON Schema validation with reference schema mappings support.
    • Added HTTP client configuration for JWKS retrieval.
  • Improvements

    • Enhanced admin interface to display per-destination node status.
    • Improved internal routing URL scheme formatting.
  • Chores

    • Version updates and dependency synchronization.

✏️ Tip: You can customize this high-level summary in your review settings.

christiangoerdes and others added 23 commits December 4, 2025 17:16
* feat: json2xml support for arrays

* refactor: minor

* refactor: minor

* refactor: minor

* refactor: minor

* refactor: minor

* refactor: minor

* refactor: minor

* refactor: minor

* refactor: minor

---------

Co-authored-by: Thomas Bayer <bayer@predic8.de>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: github-actions <github-actions@github.com>
#2471)

* Add support for reference schemas in JSON/YAML schema validation (infrastructure)

* Make `schemas` field private in ReferenceSchemas

* Improve logging for unsupported referenceSchemas in schema validation

* Refactor schema validation logging and add example for JSON schema with reference mappings

* Add tests for JSON schema validation with reference mappings

* improvements
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: github-actions <github-actions@github.com>
* Expand URL handling to support "internal" scheme and improve URI resolution logic in DispatchingInterceptor

* Update internal URL formats to use `internal://` scheme across tests and core implementation

* Roadmap: Remove support for `internal:<name>` syntax in target URLs, retain `internal://` as the valid format.

* Update ROADMAP.md

---------

Co-authored-by: t-burch <119930761+t-burch@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: github-actions <github-actions@github.com>
…2566)

* show load balancer node status (and failure reasons) in adminConsole

* refactor

* added doc

---------

Co-authored-by: Christian Gördes <118011644+christiangoerdes@users.noreply.github.com>
* fix ByteStreamLogging: drop fake zeros

* improve BSL
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: github-actions <github-actions@github.com>
* 6.X: Add default tcp health check

* update doku

---------

Co-authored-by: Thomas Bayer <bayer@predic8.de>
Handle scenarios where QUERY_PARAMETER is validated by using node.asText() to extract string values, ensuring better support for query parameter types.
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: github-actions <github-actions@github.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 20, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This pull request updates Membrane from version 6.3.11-SNAPSHOT to 6.3.16-SNAPSHOT while introducing several new features: a per-exchange node status tracking mechanism via ExchangeNodeStatusTracker, JSON Schema mapping/reference support, TCP-based health monitoring for load balancing, refactored JSON-to-XML conversion with configurable naming, and enhanced HTTP client integration for JWT key retrieval. Additionally, internal URL routing targets are updated from internal: to internal:// format.

Changes

Cohort / File(s) Summary
Version Bumps (6.3.11 → 6.3.16)
pom.xml, distribution/pom.xml, maven-plugin/pom.xml, test/pom.xml, annot/pom.xml, core/pom.xml, membrane.spec, core/.factorypath, war/.factorypath, distribution/examples/extending-membrane/custom-interceptor/pom.xml, distribution/examples/extending-membrane/embedding-java/pom.xml, distribution/examples/web-services-soap/add-soap-header/pom.xml, distribution/examples/xml/basic-xml-interceptor/pom.xml, distribution/examples/xml/stax-interceptor/pom.xml
Parent POM and module versions bumped across project hierarchy; artifact versions updated in factorypath files
Node Status Tracking Infrastructure
core/src/main/java/com/predic8/membrane/core/interceptor/balancer/ExchangeNodeStatusTracker.java
New class to track per-destination status codes and exceptions within an exchange; supports lazy initialization of arrays and deep cloning for heap size estimation
Exchange & Load Balancing Integration
core/src/main/java/com/predic8/membrane/core/exchange/AbstractExchange.java, core/src/main/java/com/predic8/membrane/core/exchange/Exchange.java, core/src/main/java/com/predic8/membrane/core/interceptor/balancer/LoadBalancingInterceptor.java
AbstractExchange adds nodeStatusTracker field with accessors and initializer; Exchange removes legacy nodeStatusCodes/nodeExceptions fields; LoadBalancingInterceptor adds trackNodeStatus flag to conditionally initialize tracking
Health Monitoring & Node Configuration
core/src/main/java/com/predic8/membrane/core/interceptor/balancer/BalancerHealthMonitor.java, core/src/main/java/com/predic8/membrane/core/interceptor/balancer/Node.java
BalancerHealthMonitor adds TCP-based health checking via new tcpHealthy() method; prefers configured HTTP health URL over TCP fallback; Node documentation updated to reflect dual health-check modes
HTTP Client & Retry Integration
core/src/main/java/com/predic8/membrane/core/transport/http/HttpClient.java, core/src/main/java/com/predic8/membrane/core/transport/http/RetryHandler.java
HttpClient and RetryHandler updated to use nodeStatusTracker instead of removed Exchange methods; null-safe access guards added
Admin UI & REST Serialization
core/src/main/java/com/predic8/membrane/core/interceptor/administration/AdminPageBuilder.java, core/src/main/java/com/predic8/membrane/core/interceptor/administration/AdminRESTInterceptor.java, core/src/main/java/com/predic8/membrane/core/interceptor/administration/DynamicAdminPageInterceptor.java, core/src/main/resources/com/predic8/membrane/core/interceptor/administration/docBase/admin/js/membrane.js
AdminPageBuilder adds createExchangeNodeStatusTable() method; AdminRESTInterceptor introduces detail flag to writeExchange() with new writeExchangeDetailFields() helper; UI JavaScript updated to display node status table when data present
Internal URL Routing
core/src/main/java/com/predic8/membrane/core/interceptor/DispatchingInterceptor.java
Expands target handling to accept both "http" and "internal" prefixes; switches URL resolution from URL-based to URI-based; null/empty basePath handling improved
JSON Schema Mapping Support
core/src/main/java/com/predic8/membrane/core/interceptor/schemavalidation/json/SchemaMappings.java, core/src/main/java/com/predic8/membrane/core/interceptor/schemavalidation/ValidatorInterceptor.java, core/src/main/java/com/predic8/membrane/core/interceptor/schemavalidation/json/JSONYAMLSchemaValidator.java
New SchemaMappings class with Schema inner class for ID-to-location mapping; ValidatorInterceptor adds setReferenceSchemas/getReferenceSchemas accessors and pre-validation logging; JSONYAMLSchemaValidator adds setSchemaMappings() to wire mappings into schema loader
JSON-to-XML Conversion
core/src/main/java/com/predic8/membrane/core/interceptor/xml/Json2XmlInterceptor.java, core/src/main/java/com/predic8/membrane/core/util/json/JsonToXml.java, core/src/test/java/com/predic8/membrane/core/interceptor/xml/Json2XmlInterceptorTest.java, core/src/test/java/com/predic8/membrane/core/util/json/JsonToXmlTest.java
Json2XmlInterceptor refactored to use dedicated JsonToXml converter with configurable root/array/item names; new JsonToXml utility class provides fluent API for JSON-to-XML with proper escaping and sanitization; comprehensive test suite added
JWT & JWK Integration
core/src/main/java/com/predic8/membrane/core/interceptor/jwt/Jwks.java, core/src/main/java/com/predic8/membrane/core/interceptor/jwt/JwtAuthInterceptor.java
Jwks.Jwk.getJwk() refactored to accept Router and use HTTP client configuration; httpClientConfig getter/setter added; JwtAuthInterceptor updated to pass router directly
JSON Utilities Restructuring
core/src/main/java/com/predic8/membrane/core/util/json/JsonUtil.java, core/src/main/java/com/predic8/membrane/core/openapi/validators/parameters/AbstractArrayParameterParser.java, core/src/main/java/com/predic8/membrane/core/openapi/validators/parameters/ExplodedObjectParameterParser.java, core/src/main/java/com/predic8/membrane/core/openapi/validators/parameters/ObjectParameterParser.java, core/src/main/java/com/predic8/membrane/core/openapi/validators/parameters/ScalarParameterParser.java, core/src/test/java/com/predic8/membrane/core/util/JsonUtilTest.java
JsonUtil moved from com.predic8.membrane.core.util to com.predic8.membrane.core.util.json package; multiple parameter parsers updated to import from new location
OpenAPI Validation
core/src/main/java/com/predic8/membrane/core/openapi/validators/StringValidator.java
StringValidator enhanced to extract text from non-string JSON nodes in QUERY_PARAMETER contexts using node.asText()
HTTP Transport & Logging
core/src/main/java/com/predic8/membrane/core/transport/http/ByteStreamLogging.java
Conditional logging added for read() methods to skip when EOF (-1) reached; lineSeparator inserted between byte sequence and ASCII representation
Internal URL Test Updates
core/src/test/java/com/predic8/membrane/core/interceptor/flow/invocation/internalservice/AbortInResponseFlowInternalRoutingTest.java, core/src/test/java/com/predic8/membrane/core/interceptor/flow/invocation/internalservice/AbortInternalRoutingTest.java, core/src/test/java/com/predic8/membrane/core/interceptor/flow/invocation/internalservice/RequestResponseInternalRoutingTest.java, core/src/test/java/com/predic8/membrane/core/interceptor/flow/invocation/internalservice/SimpleInternalRoutingTest.java, core/src/test/java/com/predic8/membrane/core/transport/http/ServiceInvocationTest.java, core/src/test/resources/internal-invocation/proxies.xml
Internal routing target URLs updated from internal: format to internal:// format across test configurations
Schema Mapping Examples
distribution/examples/validation/json-schema/schema-mappings/README.md, distribution/examples/validation/json-schema/schema-mappings/proxies.xml, distribution/examples/validation/json-schema/schema-mappings/membrane.sh, distribution/examples/validation/json-schema/schema-mappings/membrane.cmd, distribution/examples/validation/json-schema/schema-mappings/schemas/base-param.json, distribution/examples/validation/json-schema/schema-mappings/schemas/meta.json, distribution/examples/validation/json-schema/schema-mappings/schemas/schema2000.json, distribution/examples/validation/json-schema/schema-mappings/schemas/schema2001.json, distribution/examples/validation/json-schema/schema-mappings/good\*.json, distribution/examples/validation/json-schema/schema-mappings/bad\*.json
New schema-mappings example demonstrating JSON Schema validation with external reference schemas; includes multiple test payloads, startup scripts, and referenced schema definitions
Schema Mapping Tests
distribution/src/test/java/com/predic8/membrane/examples/withoutinternet/validation/JSONSchemaMappingsExampleTest.java
New integration test for schema-mappings example verifying validation against both valid and invalid payloads on ports 2000 and 2001
Build & Configuration
.gitignore, distribution/scripts/start_router.sh
.gitignore updated to exclude distribution/conf/apis.yaml and distribution/conf/membrane.log; start_router.sh narrowed to only normalize -Dlog4j.configurationFile in JAVA_OPTS

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • rrayst

Poem

🐰 Hops through the code with version cheer,
Six-three-sixteen brings features near!
Node tracking hops, schemas dance,
Health checks bounce in TCP's trance,
JSON transforms with XML flair, 🎉

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants