Feature/message queue abstraction - #20
Merged
Merged
Conversation
Defines the generic IMessageQueue<T> abstraction with PublishAsync and ConsumeAsync (IAsyncEnumerable stream), plus the three payload types (ProjectDescriptionPayload, SkillRequirementsResult, RoleRequirement) that cross the boundary between the backend and the LLM service. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements IMessageQueue<T> with Azure Queue Storage: publishes via SendMessageAsync and consumes via an IAsyncEnumerable polling loop that deletes each message after it is yielded. Adds MessageQueueOptions config and an AddMessageQueues extension registered in Program.cs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers: publish serialises to snake_case JSON, consume yields and deletes messages, malformed messages are skipped but still deleted, and consuming with a pre-cancelled token does not poll the queue. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Cancel after all expected messages are received rather than after the first, and use two valid messages in the malformed-skip test so the count assertion proves both were yielded rather than just that we stopped early. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AddMessageQueues was instantiating QueueClient at registration time, which threw when the connection string was absent in CI. Changed to factory delegates so construction is deferred until first resolve. Added IMessageQueue<T> mocks to ApiFactory so integration tests never resolve the real implementation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Description
Adds the message queue infrastructure that will underpin the LLM-driven recommendation system (issue #8). This is the first of three PRs — it lays the foundation that the outbound dispatch (PR 2) and inbound team-building (PR 3) services will build on.
IMessageQueue<T>— a generic abstraction with two methods:PublishAsync— serialise and send a messageConsumeAsync— returns anIAsyncEnumerable<T>stream; the implementation polls the queue, yields each message, then deletes it (acknowledges) before moving to the next. Malformed messages are deleted without yielding so they don't block the stream.AzureStorageQueueMessageQueue<T>— the concrete implementation backed by Azure Queue Storage. Messages are JSON-serialised with snake_case naming (matching the rest of the API) and base64-encoded by the SDK.Data contracts — three record types that cross the boundary with the LLM service:
ProjectDescriptionPayload— sent outbound; contains only project description data (no user skill data ever leaves the backend)SkillRequirementsResult— received inbound from the LLM serviceRoleRequirement— a role name and the list of skills required to fill itConfig & DI —
MessageQueueOptionsbinds fromMessageQueuein app settings (connection string + queue names).AddMessageQueuesextension registers both typedIMessageQueue<T>singletons.Linked issues
(Optional) Screenshots
N/A — backend infrastructure change with no UI impact.