abp-microservice
Skill0 starsChanged 5 days agoMITView on GitHub
Use when working with the ABP microservice solution template or inter-service communication patterns. Covers service structure, Integration Services ([IntegrationService]), inter-service HTTP proxies, distributed events with Outbox/Inbox, Entity Cache, and RabbitMQ/Redis/YARP setup.
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- abpframework/abpedited, first seen Oct 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- abpframework/abp★ 14k97% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository67 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- abp-angularSkill
- abp-application-layerSkill
- abp-app-nolayersSkill
- abp-authorizationSkill
- abp-blazorSkill
- abp-cliSkill
- abp-coreSkill
- abp-dddSkill
- abp-dependency-rulesSkill
- abp-development-flowSkill
- abp-ef-coreSkill
- abp-infrastructureSkill
- abp-moduleSkill
- abp-mongodbSkill
- abp-multi-tenancySkill
- abp-mvcSkill
- abp-testingSkill
- aspnet-core-apiSkill
- brainstormingSkill
- building-mcp-serversSkill
- caveman-commitSkill
- caveman-compressSkill
- caveman-reviewSkill
- cavemanSkill
- chrome-devtoolsSkill
- create-agent-harnessSkill
- defuddleSkill
- design-patternsSkill
- dispatching-parallel-agentsSkill
- efcore-patternsSkill
- ef-coreSkill
- entity-framework-coreSkill
- executing-plansSkill
- find-skillsSkill
- finishing-a-development-branchSkill
- fluentui-blazorSkill
- github-issuesSkill
- harness-repo-structureSkill
- json-canvasSkill
- memory-mergerSkill
- microsoft-agent-frameworkSkill
- microsoft-code-referenceSkill
- microsoft-docsSkill
- microsoft-skill-creatorSkill
- migrate-aspnetboilerplate-to-abpSkill
- modern-csharp-coding-standardsSkill
- performance-optimizationSkill
- postgresql-code-reviewSkill
- postgresql-optimizationSkill
- premium-frontend-uiSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- rtk-token-killerSkill
- security-jwtSkill
- sonarqube-fixSkill
- sql-code-reviewSkill
- sql-optimizationSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 86
Add reference to provider's Contracts project (via ABP Studio or manually):
- Distinctive: line 151
Use RabbitMQ-based events for loose coupling.
- Distinctive: line 156
When services should remain independent and decoupled
- Distinctive: line 206
Use Integration Services: - Not application services for inter-service calls
- Distinctive: line 207
Cache remote data: - Use Entity Cache or IDistributedCache for frequently accessed data
- Distinctive: line 208
Share only Contracts: - Never share implementations
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ABP Microservice Solution Template
Docs: https://abp.io/docs/latest/solution-templates/microservice
Solution Structure
MyMicroservice/
├── apps/ # UI applications
│ ├── web/ # Web application
│ ├── public-web/ # Public website
│ └── auth-server/ # Authentication server (OpenIddict)
├── gateways/ # BFF pattern - one gateway per UI
│ └── web-gateway/ # YARP reverse proxy
├── services/ # Microservices
│ ├── administration/ # Permissions, settings, features
│ ├── identity/ # Users, roles
│ └── [your-services]/ # Your business services
└── etc/
├── docker/ # Docker compose for local infra
└── helm/ # Kubernetes deploymentMicroservice Structure (NOT Layered!)
Each microservice has simplified structure - everything in one project:
services/ordering/
├── OrderingService/ # Main project
│ ├── Entities/
│ ├── Services/
│ ├── IntegrationServices/ # For inter-service communication
│ ├── Data/ # DbContext (implements IHasEventInbox, IHasEventOutbox)
│ └── OrderingServiceModule.cs
├── OrderingService.Contracts/ # Interfaces, DTOs, ETOs (shared)
└── OrderingService.Tests/Inter-Service Communication
1. Integration Services (Synchronous HTTP)
For synchronous calls, use Integration Services - NOT regular application services.
Step 1: Provider Service - Create Integration Service
// In CatalogService.Contracts project
[IntegrationService]
public interface IProductIntegrationService : IApplicationService
{
Task<List<ProductDto>> GetProductsByIdsAsync(List<Guid> ids);
}
// In CatalogService project
[IntegrationService]
public class ProductIntegrationService : ApplicationService, IProductIntegrationService
{
public async Task<List<ProductDto>> GetProductsByIdsAsync(List<Guid> ids)
{
var products = await _productRepository.GetListAsync(p => ids.Contains(p.Id));
return ObjectMapper.Map<List<Product>, List<ProductDto>>(products);
}
}Step 2: Provider Service - Expose Integration Services
// In CatalogServiceModule.cs
Configure<AbpAspNetCoreMvcOptions>(options =>
{
options.ExposeIntegrationServices = true;
});Step 3: Consumer Service - Add Package Reference
Add reference to provider's Contracts project (via ABP Studio or manually):
- Right-click OrderingService → Add Package Reference → Select
CatalogService.Contracts
Step 4: Consumer Service - Generate Proxies
# Run ABP CLI in consumer service folder
abp generate-proxy -t csharp -u http://localhost:44361 -m catalog --without-contractsOr use ABP Studio: Right-click service → ABP CLI → Generate Proxy → C#
Step 5: Consumer Service - Register HTTP Client Proxies
// In OrderingServiceModule.cs
[DependsOn(typeof(CatalogServiceContractsModule))] // Add module dependency
public class OrderingServiceModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
// Register static HTTP client proxies
context.Services.AddStaticHttpClientProxies(
typeof(CatalogServiceContractsModule).Assembly,
"CatalogService");
}
}Step 6: Consumer Service - Configure Remote Service URL
// appsettings.json
"RemoteServices": {
"CatalogService": {
"BaseUrl": "http://localhost:44361"
}
}Step 7: Use Integration Service
public class OrderAppService : ApplicationService
{
private readonly IProductIntegrationService _productIntegrationService;
public async Task<List<OrderDto>> GetListAsync()
{
var orders = await _orderRepository.GetListAsync();
var productIds = orders.Select(o => o.ProductId).Distinct().ToList();
// Call remote service via generated proxy
var products = await _productIntegrationService.GetProductsByIdsAsync(productIds);
// ...
}
}Why Integration Services? Application services are for UI - they have different authorization, validation, and optimization needs. Integration services are designed specifically for inter-service communication.
When to use: Need immediate response, data required to complete current operation (e.g., get product details to display in order list).
2. Distributed Events (Asynchronous)
Use RabbitMQ-based events for loose coupling.
When to use:
- Notifying other services about state changes (e.g., "order placed", "stock updated")
- Operations that don't need immediate response
- When services should remain independent and decoupled
// Define ETO in Contracts project
[EventName("Product.StockChanged")]
public class StockCountChangedEto
{
public Guid ProductId { get; set; }
public int NewCount { get; set; }
}
// Publish
await _distributedEventBus.PublishAsync(new StockCountChangedEto { ... });
// Subscribe in another service
public class StockChangedHandler : IDistributedEventHandler<StockCountChangedEto>, ITransientDependency
{
public async Task HandleEventAsync(StockCountChangedEto eventData) { ... }
}DbContext must implement IHasEventInbox, IHasEventOutbox for Outbox/Inbox pattern.
Performance: Entity Cache
For frequently accessed data from other services, use Entity Cache:
// Register
context.Services.AddEntityCache<Product, ProductDto, Guid>();
// Use - auto-invalidates on entity changes
private readonly IEntityCache<ProductDto, Guid> _productCache;
public async Task<ProductDto> GetProductAsync(Guid id)
{
return await _productCache.GetAsync(id);
}Pre-Configured Infrastructure
- RabbitMQ - Distributed events with Outbox/Inbox
- Redis - Distributed cache and locking
- YARP - API Gateway
- OpenIddict - Auth server
Best Practices
- Choose communication wisely - Synchronous for queries needing immediate data, asynchronous for notifications and state changes
- Use Integration Services - Not application services for inter-service calls
- Cache remote data - Use Entity Cache or IDistributedCache for frequently accessed data
- Share only Contracts - Never share implementations
- Idempotent handlers - Events may be delivered multiple times
- Database per service - Each service owns its database
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

