Skip to content

MongoJobRepositoryFactoryBean requirement for MapKeyDotReplacement should be enforced #5346

@snicoll

Description

@snicoll

The Javadoc of MongoJobRepositoryFactoryBean provides all the need that you need

* template and a mongo transaction manager. <strong>The mongo template must be configured
* with a {@link MappingMongoConverter} having a {@code MapKeyDotReplacement} set to a non
* null value. See {@code MongoDBJobRepositoryIntegrationTests} for an example. This is
* required to support execution context keys containing dots (like "step.type" or
* "batch.version")</strong>

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions