Skip to content

fix(mdx-web): retain Jackson JSON converter for actuator serialization - #390

Open
gerfboy wants to merge 1 commit into
masterfrom
greg/actuator-health-json-converter
Open

fix(mdx-web): retain Jackson JSON converter for actuator serialization#390
gerfboy wants to merge 1 commit into
masterfrom
greg/actuator-health-json-converter

Conversation

@gerfboy

@gerfboy gerfboy commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary of Changes

Under Spring Boot 4.1.0, path connectors on mdx-web fail their Kubernetes health probes. /actuator/health throws:

HttpMessageNotWritableException: No converter for [class org.springframework.boot.health.actuate.endpoint.SystemHealthDescriptor] with preset Content-Type 'null'

MdxOnDemandSerializationWebMvcConfigurer.extendMessageConverters removes every HTTP message converter not in its allowlist (CONVERT_CLASSES: Gson, String, ByteArray) and appends a custom XML converter. Under Spring Boot 4 the actuator health payload (SystemHealthDescriptor) is serialized with Jackson, so with the Jackson JSON converter stripped there is no writable converter for it and the endpoint fails. This is a regression from the Boot 4 migration.

This change adds JacksonJsonHttpMessageConverter to the allowlist so actuator (and any non-MDX JSON) endpoints can serialize, while MDX endpoints continue to use Gson.

Jira: MC-15733

Public API Additions/Changes

None. Internal Spring MVC message-converter configuration only.

Downstream Consumer Impact

Bug fix. Restores serialization of Spring Boot actuator endpoints (e.g. /actuator/health), which unblocks Kubernetes health probes for connectors on Boot 4. MDX endpoints are unaffected — they continue to serialize via Gson. No behavior change for existing MDX request/response paths.

How Has This Been Tested?

  • ./gradlew :mdx-web:check (JDK 21) — build, checkstyle, spotbugs, and tests pass
  • Updated MdxOnDemandSerializationWebMvcConfigurerTest to assert the Jackson JSON converter survives converter filtering (retained alongside Gson/String/ByteArray, custom XML converter still appended last)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

MdxOnDemandSerializationWebMvcConfigurer strips every message converter
not in its allowlist. Under Spring Boot 4 the actuator health endpoint
returns SystemHealthDescriptor, which is serialized with Jackson; with
the Jackson JSON converter removed there is no writable converter for it,
so /actuator/health fails with HttpMessageNotWritableException ("No
converter for [SystemHealthDescriptor] with preset Content-Type 'null'")
and Kubernetes health probes never pass.

Add JacksonJsonHttpMessageConverter to the allowlist so actuator (and any
non-MDX JSON) endpoints can serialize, while MDX endpoints continue to
use Gson.
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.

1 participant