coreex-subscriber

Implements event and command subscribers in CoreEx Subscribe hosts with delegation patterns.

28|8|Updated Feb 21, 2022
One-click install
npx skills add https://github.com/Avanade/CoreEx --skill coreex-subscriber-avanade
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: coreex-subscriber
Source: https://github.com/Avanade/CoreEx/tree/main/.github/skills/coreex-subscriber
Command: npx skills add https://github.com/Avanade/CoreEx --skill coreex-subscriber-avanade

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building message-driven .NET services requires consistent patterns for receiving commands and events from a broker, validating payloads, handling errors, and delegating to application logic. This Skill guides you through adding or modifying subscribers in a CoreEx Subscribe host so each subscriber stays a thin routing layer with no embedded business logic. ## Core Features & Use Cases - Three Subscriber Scenarios: Distinguishes command subscribers (delegate to application services), event data-sync subscribers (delegate to IXxxSyncAdapter replication adapters), and event business-process subscribers (choreography steps delegating to application services). - Typed and Untyped Subscribers: Covers SubscribedBase for key-only messages and SubscribedBase<TValue> with ValueValidator for payload-carrying messages, plus subject naming conventions with payload-driven .v{n} version suffixes. - Error Handling and Saga Guidance: Configures shared static ErrorHandler instances for graceful not-found and retry/dead-letter control, and explains choreography-based saga design with idempotency and compensation rules. - Use Case: You need to react to a product.updated event from another domain and keep a local cached copy. The Skill produces a typed ModifySubscriber with a ValueValidator that delegates to your sync adapter, with no Program.cs changes required thanks to AddSubscribersUsing discovery. ## Quick Start Ask the AI to add a CoreEx subscriber for a given scenario, subject, and payload type, for example: create a typed event data-sync subscriber for the subject contoso.products.product.updated.v1 that validates the payload and delegates to IProductSyncAdapter.

Frequently Asked Questions about coreex-subscriber

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add an event subscriber in a CoreEx Subscribe host?▼

Create a class decorated with [ScopedService] and one or more [Subscribe("subject")] attributes, inheriting SubscribedBase for key-only messages or SubscribedBase<TValue> for payloads. AddSubscribersUsing<T>() discovers it automatically, so no Program.cs change is needed.

What is the difference between command and event subscribers in CoreEx?▼

Command subscribers handle commands addressed to this domain and delegate to an application service. Event subscribers react to events from other domains, either delegating to an IXxxSyncAdapter for data synchronization or to an application service for a choreography step.

When should a CoreEx subscriber subject include a .v1 version suffix?▼

Include the .v{n} suffix whenever the message carries a serialized payload, for both commands and events. Omit it for key-only messages such as deletes, since the version reflects the payload schema rather than the message type.

How do I handle not-found errors in a CoreEx subscriber without dead-lettering?▼

Define a static ErrorHandler that maps NotFoundException to ErrorHandling.CompleteAsInformation, then assign it in the constructor body. The same static instance can be shared across related subscribers such as confirm and cancel.

When should I not use a CoreEx subscriber?▼

Do not use subscribers for HTTP API endpoints, application service logic, or replication adapter implementations, which belong to dedicated layers. Also never subscribe to commands addressed to another domain; use events for cross-domain coordination instead.