Merged
Conversation
Includes Testcontainers project for end to end Rabbit message testing
Migrates from constructor-based to property-based initialization for message payloads, ensuring consistency in data transfer between services.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors several background services and messaging components to simplify dependencies and unify messaging through a single
IMessageServiceinterface. 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:
BlockingBackgroundService,CleanupBackgroundService, andDbBackgroundServiceto use constructor parameters for dependencies and replaced multiple messaging interfaces with a unifiedIMessageService. This change streamlines message publishing and subscribing throughout the services. [1] [2] [3]OfflocCleanupServiceto remove its dependency on messaging services, relying only on file location configuration.DbInteractionServiceto useIMessageServicefor status updates, replacing the previousIStatusMessagingServicedependency. [1] [2] [3]Solution and Package Configuration:
Messaging.Testsproject to the solution and configured its build settings, enabling improved test coverage for messaging components. [1] [2] [3]Testcontainers.RabbitMqandTestcontainers.Xunitpackages to support containerized integration testing for RabbitMQ and xUnit-based tests.These changes collectively increase code clarity, make testing easier, and support future extensibility.