Skip to content

Improve default message round-trip consistency by auto-discovering Jackson modules#289

Merged
sonus21 merged 1 commit intosonus21:masterfrom
JiHongKim98:fix/default-mapper-roundtrip-consistency
Mar 23, 2026
Merged

Improve default message round-trip consistency by auto-discovering Jackson modules#289
sonus21 merged 1 commit intosonus21:masterfrom
JiHongKim98:fix/default-mapper-roundtrip-consistency

Conversation

@JiHongKim98
Copy link
Contributor

Description

Rqueue currently creates its default ObjectMapper with minimal configuration only.
This can cause default enqueue/dequeue round-trip failures for payload types that
depend on Jackson modules present on the application classpath.

This PR updates the default mapper creation path to call findAndAddModules()
so that the default message conversion path is more consistent for enqueue,
dequeue, and listener argument mapping.

Changes:

  • update SerializationUtils.createObjectMapper() to use findAndAddModules()
  • add a regression test for the default GenericMessageConverter round-trip path

Fixes # (issue number if available)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

./gradlew checkFormatJava :rqueue-core:test --tests com.github.sonus21.rqueue.converter.GenericMessageConverterTest --tests com.github.sonus21.rqueue.converter.JsonMessageConverterTest
  • Unit Test
  • Integration Test
  • Reactive Integration Test

Test Configuration:

  • Spring Version: 7.0.3
  • Spring Boot Version: 4.0.1
  • Redis Driver Version: lettuce 7.2.1.RELEASE

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

The default mapper bootstrap only disabled unknown-property failures,
so payloads that depend on Jackson module discovery could serialize on
enqueue and still fail during dequeue or listener argument mapping.

This change enables module auto-discovery in SerializationUtils and
adds a regression test that verifies the default GenericMessageConverter
round-trip path with a ServiceLoader-discovered Jackson module.

Constraint: Must preserve the existing MessageConverterProvider-based extension model
Rejected: Prefer Spring-managed ObjectMapper by default | changes the library's default configuration contract
Confidence: medium
Scope-risk: narrow
Directive: If default mapper bootstrap changes again, keep equivalent regression coverage for service-loaded modules
Tested: ./gradlew checkFormatJava :rqueue-core:test --tests com.github.sonus21.rqueue.converter.GenericMessageConverterTest --tests com.github.sonus21.rqueue.converter.JsonMessageConverterTest
Not-tested: Cross-service producer/consumer environments with different classpaths
@sonus21
Copy link
Owner

sonus21 commented Mar 23, 2026

Hi @JiHongKim98 , this will merge change to version 4.x, are you using spring spring boot 4.x?

@JiHongKim98
Copy link
Contributor Author

@sonus21
Thank you for the quick review!
Yes, I am currently using both Spring Boot 4.x and 3.5 versions simultaneously.

@JiHongKim98
Copy link
Contributor Author

@sonus21
I have a few questions regarding the release process.

I noticed that there are newer versions available on Maven Central (e.g. 3.4.1, 4.0.0-RC),
but GitHub releases seem to stop at v3.4.0.

Is there a reason why newer versions are not published as GitHub releases?

@sonus21
Copy link
Owner

sonus21 commented Mar 23, 2026

@JiHongKim98 my bad, just published them

@sonus21 sonus21 merged commit aff8ae7 into sonus21:master Mar 23, 2026
9 checks passed
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.

2 participants