Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
coronabytes committed Aug 17, 2024
1 parent d8b821b commit 64d5c12
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
dotnet add package Core.ServiceMesh
```
# Service Mesh for ASP.NET Core
- based on https://nats.io
- service request reponse
- interconnect microservices sync/async with ease
- based on https://nats.io
- service request reponse pattern (sync)
- strongly typed clients out of the box
- event streaming
- event streaming via NATS JetStream (async)
- durable and transient consumers
- open telemetry support
- supports local service traces in "AutoTrace" mode

## Initialization in ASP.NET Core

```csharp
builder.AddServiceMesh(options =>
{
Expand All @@ -30,8 +32,8 @@ builder.AddServiceMesh(options =>
```

## Service Interface
- service interfaces go abstraction libs to be shared among your microservices
- only Task and Task<T> supported as return type (no ValueTask)
- service interfaces go into abstraction libs to be shared among your microservices
- only Task and Task<T> supported as return type (no ValueTask yet)
```csharp
[ServiceMesh("someservice")]
public interface ISomeService
Expand Down Expand Up @@ -68,7 +70,8 @@ public class SomeService(ILogger<SomeService> logger) : ISomeService
```

## Service Invocation

- inject service interface into your controllers/services
- they are automatically proxied over nats when not available in the same container
```csharp
public class DevController(ISomeService someService) : ControllerBase
{
Expand Down Expand Up @@ -123,13 +126,13 @@ public class DevController(IServiceMesh mesh) : ControllerBase
- no generics
- no simple types

# expose services and messages
- for this example type ending with ..Command or ..Message
## expose services and messages
- for this example types ending with ..Command or ..Message will be exposed as endpoints
```csharp
app.MapServiceMesh(["Command", "Message"]);
```

# customize or filter http endpoints
## customize or filter http endpoints
```csharp
builder.AddServiceMesh(options =>
{
Expand Down

0 comments on commit 64d5c12

Please sign in to comment.