This repository has been archived by the owner on Dec 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* new Correlation type with unique id per scope * correlation id gets automatically published in integration events * optional correlation for events outside of scopes (tenant creation)
- Loading branch information
1 parent
6733a8e
commit 3f600c5
Showing
13 changed files
with
150 additions
and
30 deletions.
There are no files selected for viewing
This file contains 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
18 changes: 18 additions & 0 deletions
18
src/abstractions/Backend.Fx/Patterns/DependencyInjection/Correlation.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System; | ||
using Backend.Fx.Logging; | ||
|
||
namespace Backend.Fx.Patterns.DependencyInjection | ||
{ | ||
public class Correlation | ||
{ | ||
private static readonly ILogger Logger = LogManager.Create<Correlation>(); | ||
|
||
public Guid Id { get; private set; } = Guid.NewGuid(); | ||
|
||
public void Resume(Guid correlationId) | ||
{ | ||
Logger.Info($"Resuming correlation {correlationId}"); | ||
Id = correlationId; | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/abstractions/Backend.Fx/Patterns/DependencyInjection/CurrentCorrelationHolder.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
namespace Backend.Fx.Patterns.DependencyInjection | ||
{ | ||
public class CurrentCorrelationHolder : CurrentTHolder<Correlation> | ||
{ | ||
public override Correlation ProvideInstance() | ||
{ | ||
return new Correlation(); | ||
} | ||
|
||
protected override string Describe(Correlation instance) | ||
{ | ||
if (instance == null) | ||
{ | ||
return "<NULL>"; | ||
} | ||
|
||
return $"Correlation: {instance.Id}"; | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
19 changes: 14 additions & 5 deletions
19
src/abstractions/Backend.Fx/Patterns/EventAggregation/Integration/IntegrationEvent.cs
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.