spring-projects / spring-projects/spring-batch

MongoJobRepositoryFactoryBean requirement for MapKeyDotReplacement should be enforced

Open
#5,346 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage type: feature
Dominant language
Java
Stars
3k
Forks
2.5k
Avg merge
6d 53m
Merged PRs (30d)
3

Description

The Javadoc of MongoJobRepositoryFactoryBean provides all the need that you need https://github.com/spring-projects/spring-batch/blob/0c91fa4daba99d81f09de405cd0463ab3d0fde16/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/MongoJobRepositoryFactoryBean.java#L33-L37

However, this concretely makes you create a MongoTemplate for the purpose of Spring Batch as such requirement is unusual.

I am not an expert but asked @mp911de and he's suggesting to:

not use dots in field/property names and instead do the translation differently, by e.g. creating a subdocument after a property terminates at a dot.

If that's not practical, I'd suggest to deprecate protected MongoOperations getMongoOperations() and create one using MongoDatabaseFactory (that should be provided as a new getter).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the Javadoc and implementation of MongoJobRepositoryFactoryBean, especially the MapKeyDotReplacement requirement and protected getMongoOperations() mentioned in the issue. Compare the proposed MongoOperations and MongoDatabaseFactory alternatives, then establish which API and field-name behavior should change before defining completion criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, mongodb, spring
Domain
backend, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.