Skip to content

[NAE-2342] Improve Quartz configuration#404

Merged
tuplle merged 1 commit intorelease/6.4.2from
NAE-2342
Jan 12, 2026
Merged

[NAE-2342] Improve Quartz configuration#404
tuplle merged 1 commit intorelease/6.4.2from
NAE-2342

Conversation

@dominikvozr
Copy link

@dominikvozr dominikvozr commented Jan 12, 2026

Added new property nae.quartz.mongoOptionWriteConcernW for quartz mongo write concern policy

Description

Added new property nae.quartz.mongoOptionWriteConcernW for quartz mongo write concern policy

Implements NAE-2342

Dependencies

  • nae.quartz.mongoOptionWriteConcernW

Third party dependencies

  • No new dependencies were introduced

Blocking Pull requests

  • There are no dependencies on other PR

How Has Been This Tested?

This improvement was tested on local device and checked if MongoDB write concern changes for Quartz

Tested with properties:

  • logging.level.org.mongodb.driver.protocol.command=DEBUG
  • logging.level.org.mongodb.driver.connection=INFO
  • logging.level.org.mongodb.driver.cluster=INFO
  • nae.quartz.mongoOptionWriteConcernW=W1

Test Configuration

<Please describe configuration for tests to run if applicable, like program parameters, host OS, VM configuration etc.>

Name Tested on
OS Windows
Runtime corretto-11.0.22
Dependency Manager Maven 3.9
Framework version Spring
Run parameters
Other configuration

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes have been checked, personally or remotely, with @tuplle
  • I have commented my code, particularly in hard-to-understand areas
  • I have resolved all conflicts with the target branch of the PR
  • I have updated and synced my code with the target branch
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes:
    • Lint test
    • Unit tests
    • Integration tests
  • I have checked my contribution with code analysis tools:
  • I have made corresponding changes to the documentation:
    • Developer documentation
    • User Guides
    • Migration Guides

Summary by CodeRabbit

  • Chores
    • Enhanced configuration for scheduled job execution reliability with improved database write consistency settings.

✏️ Tip: You can customize this high-level summary in your review settings.

@dominikvozr dominikvozr self-assigned this Jan 12, 2026
@dominikvozr dominikvozr added improvement A change that improves on an existing feature Extra Small update labels Jan 12, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 12, 2026

Walkthrough

Adds a new configuration property mongoOptionWriteConcernW with a default value of "majority" to the Quartz scheduler configuration. The property is injected and propagated to the Quartz MongoDB job store settings.

Changes

Cohort / File(s) Summary
Quartz MongoDB Configuration
src/main/java/com/netgrif/application/engine/configuration/quartz/QuartzConfiguration.java
Adds mongoOptionWriteConcernW property injection via @Value annotation with default "majority" and propagates it to Quartz scheduler's MongoDB job store configuration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'NAE-2342 Improve Quartz configuration' is vague and generic. While 'Improve Quartz configuration' is somewhat related to the actual change (adding a MongoDB write concern property), it lacks specificity about what improvement is being made and doesn't clearly convey the primary change. Consider a more specific title like 'NAE-2342 Add mongoOptionWriteConcernW property to Quartz MongoDB configuration' to clearly indicate the concrete change being made.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/java/com/netgrif/application/engine/configuration/quartz/QuartzConfiguration.java (1)

90-91: Pre-existing bug: Second setQuartzProperties call overwrites the first.

Line 91 completely overwrites the properties set on line 90. This means all properties loaded from quartz.properties files via quartzProperties() are discarded, and only the programmatically-defined properties (lines 74-85) are applied.

The new mongoOptionWriteConcernW property will work because it's in the properties object used on line 91, but any file-based Quartz configuration is currently being ignored.

🔧 Proposed fix to merge properties
         SchedulerFactoryBean schedulerFactory = new SchedulerFactoryBean();
         schedulerFactory.setApplicationContext(applicationContext);
         schedulerFactory.setAutoStartup(false);
         schedulerFactory.setApplicationContextSchedulerContextKey("applicationContext");
-        schedulerFactory.setQuartzProperties(quartzProperties());
-        schedulerFactory.setQuartzProperties(properties);
+        Properties mergedProperties = quartzProperties();
+        mergedProperties.putAll(properties);
+        schedulerFactory.setQuartzProperties(mergedProperties);
         jobFactory.setApplicationContext(applicationContext);
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3a1e4f3 and 9efef6f.

📒 Files selected for processing (1)
  • src/main/java/com/netgrif/application/engine/configuration/quartz/QuartzConfiguration.java
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-18T19:20:32.658Z
Learnt from: Smotanka
Repo: netgrif/application-engine PR: 401
File: src/main/java/com/netgrif/application/engine/elastic/service/ElasticsearchQuerySanitizer.java:57-66
Timestamp: 2025-12-18T19:20:32.658Z
Learning: When performing multiple string replacements in Java files (e.g., sanitization/escaping logic like ElasticsearchQuerySanitizer), prefer using StringUtils.replaceEach() over chaining multiple StringUtils.replace() calls. This avoids cascading replacements where the result of one replacement triggers another replacement and potentially corrupts the final output. Apply this pattern to other similar sanitization code across the codebase as appropriate.

Applied to files:

  • src/main/java/com/netgrif/application/engine/configuration/quartz/QuartzConfiguration.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: Build
  • GitHub Check: task-list-completed
🔇 Additional comments (2)
src/main/java/com/netgrif/application/engine/configuration/quartz/QuartzConfiguration.java (2)

41-42: LGTM! New configuration property for MongoDB write concern.

The property injection with default value "majority" is appropriate. MongoDB's majority write concern is a good default for data durability in clustered environments.

Valid values to document for users include: "majority", "W1", "W2", "W3", or numeric strings. Consider adding a note in the project documentation about accepted values to prevent runtime configuration errors.


80-80: Property addition looks correct.

The new write concern property is correctly added to the Quartz job store configuration.

@tuplle tuplle merged commit 81c3072 into release/6.4.2 Jan 12, 2026
6 of 7 checks passed
@tuplle tuplle deleted the NAE-2342 branch January 12, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Extra Small improvement A change that improves on an existing feature update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants