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

Integrate Context and Dependency Injection (CDI) into Job Queue System #29898

Closed
Tracked by #29474
jgambarios opened this issue Sep 5, 2024 · 0 comments · Fixed by #29945
Closed
Tracked by #29474

Integrate Context and Dependency Injection (CDI) into Job Queue System #29898

jgambarios opened this issue Sep 5, 2024 · 0 comments · Fixed by #29945

Comments

@jgambarios
Copy link
Contributor

jgambarios commented Sep 5, 2024

Parent Issue

#29474

User Story

Enhance the design and implementation of our job handling system by incorporating Context and Dependency Injection (CDI) using Weld. This improvement aims to increase modularity, flexibility, and testability of the job queue system.

Objectives:

  1. Implement CDI throughout the job queue system to manage dependencies and lifecycle of components.
  2. Utilize CDI features to make the system more configurable and easier to extend.
  3. Improve testability by leveraging CDI for easier mocking and dependency substitution.

Tasks:

  1. Refactor key components to be CDI-managed beans:
    • JobQueueManagerAPI implementation
    • JobQueue implementations (PostgresJobQueue, potential future implementations)
    • JobProcessor implementations
    • CircuitBreaker
    • RetryStrategy implementations
  2. Implement CDI producers for configurable components (e.g., JobQueue implementation selection).
  3. Utilize CDI qualifiers for different implementations of the same interface (e.g., @postgres, @redis for JobQueue).
  4. Implement CDI events for job state changes to decouple components.
  5. Use @PostConstruct and @PreDestroy for proper initialization and cleanup of components.
  6. Update unit tests to work with CDI, utilizing test-specific alternatives where necessary.
  7. Document the new CDI-based architecture and update any relevant diagrams.

Benefits:

  • Improved modularity and separation of concerns
  • Easier management of dependencies and component lifecycles
  • More flexible configuration options
  • Enhanced testability through easier mocking and dependency substitution
  • Preparation for future extensibility (e.g., adding new job queue implementations)

Acceptance Criteria

  1. All key components of the job queue system are managed by CDI.
  2. The system can be configured to use different implementations (e.g., job queues) through CDI mechanisms.
  3. Unit and integration tests are updated to work with the CDI-based architecture.
  4. Documentation is updated to reflect the new CDI-based design.

Proposed Objective

Core Features

Proposed Priority

Priority 3 - Average

@jgambarios jgambarios self-assigned this Sep 5, 2024
@jgambarios jgambarios moved this from New to In Progress in dotCMS - Product Planning Sep 5, 2024
@jgambarios jgambarios linked a pull request Sep 10, 2024 that will close this issue
@jgambarios jgambarios moved this from In Progress to In Review in dotCMS - Product Planning Sep 10, 2024
@github-project-automation github-project-automation bot moved this from In Review to Internal QA in dotCMS - Product Planning Sep 11, 2024
@jgambarios jgambarios moved this from Internal QA to Done in dotCMS - Product Planning Sep 11, 2024
@nollymar nollymar removed the Release : 24.09.21 UVE // Java21 label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants