Feature 029: Message Request Management & Monitoring#35
Merged
Conversation
Phase 1: API Completion
Added missing replay functionality to align all async services:
- FeedingService: Individual replay (POST /feedings/requests/{id}/replay)
- FeedingService: Batch replay (POST /feedings/requests/replay-all)
- TrainingService: Batch replay (POST /trainings/requests/replay-all)
Service implementation follows BreedingService pattern:
- Returns false/404 for completed requests to prevent re-processing
- Resets Failed status to Pending before republishing
- Batch operations use SemaphoreSlim for parallel processing
- Returns count of published messages
Tests:
- 12 new passing tests covering service and controller behavior
- Uses reflection for anonymous object assertions
- All 781 tests passing
Documentation:
- Feature spec: 029-message-request-management.md
- Implementation plan with 6 TDD phases
Phase 2: Schema Migration Updated FeedingRequestConfiguration to align with other request entities: - Added "fed" schema (matching brd, rac, trn pattern) - Configured Status property with byte conversion and default value - Added FailureReason max length (1024 characters) - Made required properties explicit (HorseId, FeedingId, OwnerId, etc.) - Added indexes on Status, CreatedDate, and HorseId for query performance All four async services now have consistent schema organization: - BreedingRequest: brd schema - RaceRequest: rac schema - TrainingRequest: trn schema - FeedingRequest: fed schema Tests: All 781 tests passing
Phase 3: MessageService & Controller (Aggregation Layer)
Created unified API for viewing and managing async request messages across
all services (Breeding, Feeding, Racing, Training).
New components:
- RequestServiceType enum: Unified service type identifier
- RequestStatus enum: Unified status mapping across all services
- MessageRequestSummary DTO: Individual request summary with service context
- MessageRequestsSummaryResult DTO: Aggregated counts per service
- IMessageService: Interface for cross-service querying
- MessageService: Implementation with GetSummaryAsync and GetAllRequestsAsync
- MessagesController: REST endpoints for summary, listing, and replay delegation
API endpoints:
- GET /api/messages/summary: Status counts for all services
- GET /api/messages: Paginated list with status/service type filters
- POST /api/messages/{serviceType}/{id}/replay: Individual replay delegation
- POST /api/messages/{serviceType}/replay-all: Batch replay delegation
Design decisions:
- Status filtering uses enum byte casting for consistency
- Service type filtering skips irrelevant tables for performance
- Training service replay wrapped to return bool (consistency)
- Richardson Maturity Model Level 2 (HTTP verbs, proper status codes)
- 202 Accepted for async operations
Tests:
- 11 new passing tests (4 service + 7 controller)
- All 792 tests passing
DI registration:
- MessageService registered in Program.cs
Implemented real-time message queue monitoring widget on the home page: - Created MessagesApiClient for API communication - Built MessageRequestWidget with auto-refresh (30s intervals) - Added pending/failed counts for all 4 services (Breeding, Feeding, Racing, Training) - Implemented skeleton loading states and error handling with retry - Integrated widget into Home page grid layout
- Implemented database-level pagination using specifications with dynamic buffer sizing - Fixed pagination to properly skip records when navigating pages - Added Messages.razor management page with grid, filters, and pagination - Extended MessagesApiClient with GetAllRequests, ReplayRequest, and ReplayAll methods - Used RefreshItems callback pattern for automatic pagination updates
- Refactor MessageService to use database-level pagination with Ardalis.Specification - Implement dynamic buffer sizing to handle cross-table aggregation efficiently - Fix Messages page pagination using RefreshItems callback pattern - Add ID column to message request grid - Add Message Queues navigation link with mail icon - Update Home dashboard with message queue summary cards Performance improvements eliminate timeout issues by avoiding loading entire tables into memory.
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.
Summary
Implement comprehensive admin dashboard widget and management page for viewing, monitoring, and replaying asynchronous message requests across all four microservices (Breeding, Feeding, Racing, Training).
Changes
Phase 1: API Completion
Phase 2: Schema Consistency
fedschema for consistency with other servicesPhase 3: Unified Message Service
Phase 4: Dashboard Widget
Phase 5: Management Page
Phase 6: Performance & UX Improvements
API Endpoints
New unified endpoints:
GET /api/messages/summary- Get aggregated status countsGET /api/messages- Get paginated requests with filteringPOST /api/messages/{serviceType}/{id}/replay- Replay individual requestPOST /api/messages/{serviceType}/replay-all- Batch replay by serviceAdded service-specific endpoints:
POST /api/feedings/requests/{id}/replayPOST /api/feedings/requests/replay-allPOST /api/trainings/requests/replay-allTechnical Details
Testing
Related