Skip to content
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

Revisit the default configuration of ExecutionContextSerializer with EnableBatchProcessing #4140

Closed
fmbenhassine opened this issue Jun 28, 2022 · 2 comments

Comments

@fmbenhassine
Copy link
Contributor

As of v4, the Jackson2ExecutionContextStringSerializer is used as the default (de)serializer when using @EnableBatchProcessing. While Jackson is definitely one of the best json processing libraries in the Java ecosystem, it has several issues:

  • Several CVEs was reported against Jackson since it was introduced in Spring Batch in v4 five years ago. This caused us a lot of maintenance effort/burden to release new versions with high SLA.
  • It happens that Jackson does not respect semantic versioning. While we understand that semver is not easy to apply rigorously, we have been hit several times by non-backward compatible changes in Jackson's patch and minor versions.
  • This is related to the previous point. The non respect of semver from Jackson caused us incompatibilites with Spring Boot releases, given the difference in the release cadence between Spring Boot and Spring Batch.

Goals

For all the reasons mentioned above, we are intending to:

  • change the default execution context serializer to a different implementation, and make the choice of Jackson as opt-in instead of opt-out (ie Jackson should become an optional dependency).
  • Add another implementation of ExecutionContextSerializer based on Google's Gson, to give our users the choice between at least two implementations out-of-the-box.

Non Goals

There is no plan to deprecate or remove the current Jackson2ExecutionContextStringSerializer.

@mdeinum
Copy link
Contributor

mdeinum commented Jun 29, 2022

Maybe introduce (and document) an algorithm like Spring Boot does when selecting a DataSource to use depending on what is available on the classpath?

@fmbenhassine
Copy link
Contributor Author

@mdeinum That's a good idea! However, I would let this kind of features (based on classpath scanning, etc) to Spring Boot.

The goal here is to change the default execution context serializer and make Jackson optional. Any improvement to the way the serializer is selected should be done in another issue.

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

No branches or pull requests

2 participants