Skip to content

Add test to reproduce Invalid server response: 19#2698

Closed
christiangoerdes wants to merge 29 commits into
masterfrom
invalid-server-response
Closed

Add test to reproduce Invalid server response: 19#2698
christiangoerdes wants to merge 29 commits into
masterfrom
invalid-server-response

Conversation

@christiangoerdes

@christiangoerdes christiangoerdes commented Jan 28, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Release Notes

  • New Features

    • Added node status tracking to monitor per-destination outcomes during load balancing.
    • Introduced TCP health checks as fallback when HTTP health URLs are not configured.
    • Added schema mappings for JSON Schema validation to reference external schema files.
    • Enhanced JSON-to-XML conversion with configurable root, array, and item element names.
  • Documentation

    • Added examples and guide for using schema mappings in JSON Schema validation.

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

christiangoerdes and others added 29 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>
* 6.X: add support for custom HttpClient configurations in JWK

* add doku

* add doku

* code improvements
…ad of `SimpleDateFormat`. (#2673)

* Refactor logging service to use `DateTimeFormatter` instead of `SimpleDateFormat` and handle timestamp conversion exceptions.

* Fix synchronization issue with `SimpleDateFormat` in `AccessLogInterceptorService` by using `DateTimeFormatter`.
…global` or `chaindef` (#2671)

* Fix `BalancerUtil` to also return clusters and balancers defined in `global` or `chaindef`

* add support for balancer beans

* fix tests

* use streams

* make balancerlist distinct

---------

Co-authored-by: Thomas Bayer <bayer@predic8.de>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Tobias Polley <polley@predic8.de>
Co-authored-by: github-actions <github-actions@github.com>
@coderabbitai

coderabbitai Bot commented Jan 28, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR updates the project version from 6.3.11-SNAPSHOT to 6.3.17-SNAPSHOT across all POM files, introduces exchange-level node status tracking for load balancers, refactors JSON-to-XML conversion with a new utility class, adds schema mapping support for JSON Schema validation, improves health monitoring with TCP checks, and includes comprehensive test/example files for schema mapping scenarios.

Changes

Cohort / File(s) Summary
Version Updates
pom.xml, annot/pom.xml, core/pom.xml, test/pom.xml, war/pom.xml, maven-plugin/pom.xml, distribution/pom.xml, distribution/examples/extending-membrane/*/pom.xml, distribution/examples/web-services-soap/*/pom.xml, distribution/examples/xml/*/pom.xml, .factorypath (core, war), membrane.spec
Updated parent/project versions from 6.3.11-SNAPSHOT to 6.3.17-SNAPSHOT across entire build hierarchy; .gitignore adds two distribution config entries
Node Status Tracking Infrastructure
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/ExchangeNodeStatusTracker.java, core/src/main/java/com/predic8/membrane/core/interceptor/balancer/LoadBalancingInterceptor.java
Introduces ExchangeNodeStatusTracker class for per-destination status tracking; adds getter/setter/init methods to AbstractExchange; removes old per-destination fields from Exchange; adds configurable trackNodeStatus flag to LoadBalancingInterceptor
Node Status Tracker Usage
core/src/main/java/com/predic8/membrane/core/transport/http/HttpClient.java, core/src/main/java/com/predic8/membrane/core/transport/http/client/RetryHandler.java
Replaces direct node status methods with null-safe calls to exc.getNodeStatusTracker() for tracking codes and exceptions
Admin UI & REST API Updates
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
Adds createExchangeNodeStatusTable method; introduces detail flag for selective JSON field emission in REST API; adds node status section to dynamic admin UI; updates JavaScript to render node status tables
Load Balancer Health Monitoring
core/src/main/java/com/predic8/membrane/core/interceptor/balancer/BalancerHealthMonitor.java, core/src/main/java/com/predic8/membrane/core/interceptor/balancer/Node.java
Adds TCP health check support via new public tcpHealthy method; replaces hardcoded health endpoint resolution with conditional HTTP/TCP routing; updates Javadoc for health check fallback behavior
Balancer Utility Refactoring
core/src/main/java/com/predic8/membrane/core/interceptor/balancer/BalancerUtil.java
Refactors balancer collection/lookup logic to use stream-based aggregation; introduces private allFlows helper; replaces nested loops with functional API; updates error messages for not-found lookups
URL Scheme Handling
core/src/main/java/com/predic8/membrane/core/interceptor/DispatchingInterceptor.java
Changes URISyntaxException handling to use router's production flag; adjusts target URL resolution for internal scheme to use URI-based base when needed; normalizes slash handling for relative paths
JSON-to-XML Conversion Refactoring
core/src/main/java/com/predic8/membrane/core/interceptor/xml/Json2XmlInterceptor.java, core/src/main/java/com/predic8/membrane/core/util/json/JsonToXml.java
Introduces new JsonToXml utility class with fluent configuration (rootName, arrayName, itemName); refactors Json2XmlInterceptor to use external converter; adds public setters/getters for array/item names; replaces inline conversion logic
JSON Schema Validation & Schema Mappings
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, core/src/main/java/com/predic8/membrane/core/interceptor/schemavalidation/json/SchemaMappings.java
Adds SchemaMappings class for structured schema reference mapping; integrates schema mapping support into ValidatorInterceptor and JSONYAMLSchemaValidator; adds public API for setReferenceSchemas/getReferenceSchemas
JWT/JWKS Configuration
core/src/main/java/com/predic8/membrane/core/interceptor/jwt/Jwks.java, core/src/main/java/com/predic8/membrane/core/interceptor/jwt/JwtAuthInterceptor.java
Changes Jwks.init signature to accept Router instead of separate resolver/location parameters; adds per-JWK HttpClientConfiguration support; updates Jwk.getJwk to use router-based resolution
Utility & Logging Updates
core/src/main/java/com/predic8/membrane/core/interceptor/log/access/AccessLogInterceptorService.java, core/src/main/java/com/predic8/membrane/core/transport/http/ByteStreamLogging.java, core/src/main/java/com/predic8/membrane/core/util/json/JsonUtil.java
Replaces SimpleDateFormat with thread-safe DateTimeFormatter; improves byte stream logging with line separators and guard clauses; relocates JsonUtil from com.predic8.membrane.core.util to com.predic8.membrane.core.util.json package
OpenAPI Validators
core/src/main/java/com/predic8/membrane/core/openapi/validators/StringValidator.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
Adds context-sensitive coercion for query parameter string validation in StringValidator; updates all parameter parsers to import JsonUtil from relocated package
Test & Example Updates
core/src/test/java/com/predic8/membrane/core/interceptor/flow/invocation/internalservice/*Test.java, core/src/test/java/com/predic8/membrane/core/interceptor/xml/Json2XmlInterceptorTest.java, core/src/test/java/com/predic8/membrane/core/transport/http/ConnectionKeepAliveTest.java, core/src/test/java/com/predic8/membrane/core/transport/http/ServiceInvocationTest.java, core/src/test/java/com/predic8/membrane/core/util/JsonUtilTest.java, core/src/test/java/com/predic8/membrane/core/util/json/JsonToXmlTest.java, core/src/test/resources/internal-invocation/proxies.xml
Updates internal service routing URLs from internal: to internal:// format; adds comprehensive JsonToXmlTest suite; enhances Json2XmlInterceptorTest with new helper and expanded coverage; adds new ConnectionKeepAliveTest; updates proxy configurations for internal routing
Schema Mapping Examples
distribution/examples/validation/json-schema/schema-mappings/*, distribution/examples/validation/json-schema/schema-mappings/schemas/*.json, distribution/src/test/java/com/predic8/membrane/examples/withoutinternet/validation/JSONSchemaMappingsExampleTest.java
Adds comprehensive example demonstrating schema mappings with proxies configuration, shell/batch scripts, sample JSON payloads, OpenAPI specification, and test suite validating good/bad request scenarios across two API endpoints
Build & Shell Script Updates
distribution/scripts/start_router.sh
Restricts JAVA_OPTS normalization to only -Dlog4j.configurationFile key instead of all -D*=* entries

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

Prio-1

Suggested reviewers

  • predic8

Poem

🐰 From versions old to snapshots new,
Node status trackers dream come true!
JSON dances into XML's embrace,
Schema mappings find their perfect place.
Health checks hop—TCP or HTTP—
A gateway's joy in every step! 🎉

✨ 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