Skip to content

Comments

Refactor messaging services#48

Merged
samgibsonmoj merged 8 commits intodevelopfrom
feature/refactor-rabbitmq
Dec 1, 2025
Merged

Refactor messaging services#48
samgibsonmoj merged 8 commits intodevelopfrom
feature/refactor-rabbitmq

Conversation

@samgibsonmoj
Copy link
Contributor

This pull request refactors several background services and messaging components to simplify dependencies and unify messaging through a single IMessageService interface. It also updates solution and package configuration to support new testing capabilities. The main changes improve code maintainability by reducing tightly coupled dependencies and standardizing message publishing/subscribing patterns.

Refactoring and Dependency Simplification:

  • Refactored BlockingBackgroundService, CleanupBackgroundService, and DbBackgroundService to use constructor parameters for dependencies and replaced multiple messaging interfaces with a unified IMessageService. This change streamlines message publishing and subscribing throughout the services. [1] [2] [3]
  • Updated OfflocCleanupService to remove its dependency on messaging services, relying only on file location configuration.
  • Modified DbInteractionService to use IMessageService for status updates, replacing the previous IStatusMessagingService dependency. [1] [2] [3]

Solution and Package Configuration:

  • Added Messaging.Tests project to the solution and configured its build settings, enabling improved test coverage for messaging components. [1] [2] [3]
  • Included Testcontainers.RabbitMq and Testcontainers.Xunit packages to support containerized integration testing for RabbitMQ and xUnit-based tests.

These changes collectively increase code clarity, make testing easier, and support future extensibility.

@samgibsonmoj samgibsonmoj requested review from a team as code owners December 1, 2025 14:54
@samgibsonmoj samgibsonmoj merged commit c33346b into develop Dec 1, 2025
2 checks passed
@samgibsonmoj samgibsonmoj deleted the feature/refactor-rabbitmq branch December 1, 2025 16:33
ryankearsley-moj pushed a commit that referenced this pull request Dec 5, 2025
* Add Messaging.Tests project

Includes Testcontainers project for end to end Rabbit message testing

* WIP: refactor RabbitService, use single Publish/Subscribe method

* Refactor DMS messaging. Use single Publish/Subscribe methods.

* Remove StatusPublish/StatusSubscribe and use generic Publish/Subscribe

* Remove IDbMessagingService and replace with generic IMessageService

* Rename messages and use DbRequestMessage<TResponse>

* Ensure RabbitService serializes generic type to concrete implementation

* Remove constructors and rely on properties for initialisation

Migrates from constructor-based to property-based initialization for message payloads,
ensuring consistency in data transfer between services.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant