Skip to content

Commit

Permalink
RE 0.10 (#31)
Browse files Browse the repository at this point in the history
* Upgrade referenced packages

* Added Silverback.EventSourcing / Silverback.EventSourcing.EntityFrameworkCore

* Upgrade to Confluent.Kafka 1.0.0

* New icon

* Fixed cast issue in QueryPublisher

* OutboundQueueWorker scheduler

* Testing

* Improve error policies (Publish)

* Fix disposed IServiceProvider issue in OutboundQueueWorker

* Fix AddBackgroundTaskManager ambiguity

* Small refactoring and unit tests for ReflectionHelper

* OutboundQueueWorkerService leveraging IHostedService

* Upgrade to Confluent.Kafka 1.0.1

* Set up CI with Azure Pipelines

[skip ci]

* Update azure-pipelines.yml for Azure Pipelines

Enabled tests

* Update azure-pipelines.yml for Azure Pipelines (#29)

Added tests

* Update README.md

Add azure pipeline status badge

* Improving logs

* Add code coverage to azure pipeline

* Enable all tests on CI pipeline

* Topic/update low risk nu get packages (#27)

* Fix some csproj formatting issues

* Update FluentAssertion, Microsoft.NET.Test.Sdk, Microsoft.EntityFrameworkCore.InMemory,NLog and NSubstitute

* Improved message unwrapping

* Added some summaries

* Fix issue #24 - IPublisher couldn't be resolved when applying configuration because it is scoped

* Update azure-pipelines.yml for Azure Pipelines

Trigger develop

* Publish code coverage

* Try to fix coverage report

* Exclude xunit from code coverage

* Feature/deserializer error handling (#30)

* Refactored Silverback.Integration to better handle deserializer errors.

* Avoid double serialization of byte array (useful when moving a not deserialized message)

* Extended Silverback.Examples to handle new policies

* Log deserialization errors

* Fix duplicated failed attempts header

* Make MaxFailedAttempts stack when chained

* Improve logs
  • Loading branch information
BEagle1984 authored Jun 16, 2019
1 parent 3ff1367 commit 293ea5c
Show file tree
Hide file tree
Showing 271 changed files with 6,252 additions and 1,399 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,12 @@ __pycache__/
*.odx.cs
*.xsd.cs

# Nuget local report
nuget/

# Coverage report
/tests/**/coverage.cobertura.xml

# OpenCover UI analysis results
OpenCover/

Expand Down
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Silverback
[![Build Status](https://travis-ci.com/BEagle1984/silverback.svg?branch=develop)](https://travis-ci.com/BEagle1984/silverback)
[![Build Status](https://dev.azure.com/beagle1984/Silverback/_apis/build/status/BEagle1984.silverback?branchName=develop)](https://dev.azure.com/beagle1984/Silverback/_build/latest?definitionId=2&branchName=develop)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/BEagle1984/silverback/blob/master/LICENSE)

Silverback is a simple framework to build reactive, event-driven, microservices.
Expand Down
37 changes: 29 additions & 8 deletions Silverback.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2026
# Visual Studio Version 16
VisualStudioVersion = 16.0.29009.5
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silverback.Core", "src\Silverback.Core\Silverback.Core.csproj", "{FE7472E6-E52F-4352-82AD-AFB700397B20}"
EndProject
Expand Down Expand Up @@ -45,15 +45,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{9818A770
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silverback.Integration.Kafka.ConfigClassGenerator", "tools\Silverback.Integration.Kafka.ConfigClassGenerator\Silverback.Integration.Kafka.ConfigClassGenerator.csproj", "{228CC403-4FBE-4E4F-9B74-891F30A404E0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1348F753-96CC-4A2E-A7D4-F5C0BE4C8BA1}"
ProjectSection(SolutionItems) = preProject
.travis.yml = .travis.yml
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silverback.Integration.InMemory", "src\Silverback.Integration.InMemory\Silverback.Integration.InMemory.csproj", "{7918D431-D931-4353-841B-4E6098D1CF70}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silverback.Integration.InMemory", "src\Silverback.Integration.InMemory\Silverback.Integration.InMemory.csproj", "{7918D431-D931-4353-841B-4E6098D1CF70}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silverback.Integration.InMemory.Tests", "tests\Silverback.Integration.InMemory.Tests\Silverback.Integration.InMemory.Tests.csproj", "{837AA9C2-1682-4B0C-8B4D-0CBE42281E48}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silverback.EventSourcing", "src\Silverback.EventSourcing\Silverback.EventSourcing.csproj", "{2DB57B2C-26CF-4635-AE66-972981DA77D9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silverback.EventSourcing.Tests", "tests\Silverback.EventSourcing.Tests\Silverback.EventSourcing.Tests.csproj", "{AB4EC3F2-A116-439E-B715-78ED415A96CC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silverback.EventSourcing.EntityFrameworkCore", "src\Silverback.EventSourcing.EntityFrameworkCore\Silverback.EventSourcing.EntityFrameworkCore.csproj", "{9AD7ECBA-BF16-4FA1-BEB3-AE7FCEFC3C7B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silverback.EventSourcing.EntityFrameworkCore.Tests", "tests\Silverback.EventSourcing.EntityFrameworkCore.Tests\Silverback.EventSourcing.EntityFrameworkCore.Tests.csproj", "{C1A5F0B5-5E48-44E6-AE01-86FAFE676630}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -144,6 +147,22 @@ Global
{837AA9C2-1682-4B0C-8B4D-0CBE42281E48}.Debug|Any CPU.Build.0 = Debug|Any CPU
{837AA9C2-1682-4B0C-8B4D-0CBE42281E48}.Release|Any CPU.ActiveCfg = Release|Any CPU
{837AA9C2-1682-4B0C-8B4D-0CBE42281E48}.Release|Any CPU.Build.0 = Release|Any CPU
{2DB57B2C-26CF-4635-AE66-972981DA77D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2DB57B2C-26CF-4635-AE66-972981DA77D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2DB57B2C-26CF-4635-AE66-972981DA77D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2DB57B2C-26CF-4635-AE66-972981DA77D9}.Release|Any CPU.Build.0 = Release|Any CPU
{AB4EC3F2-A116-439E-B715-78ED415A96CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AB4EC3F2-A116-439E-B715-78ED415A96CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AB4EC3F2-A116-439E-B715-78ED415A96CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AB4EC3F2-A116-439E-B715-78ED415A96CC}.Release|Any CPU.Build.0 = Release|Any CPU
{9AD7ECBA-BF16-4FA1-BEB3-AE7FCEFC3C7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9AD7ECBA-BF16-4FA1-BEB3-AE7FCEFC3C7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9AD7ECBA-BF16-4FA1-BEB3-AE7FCEFC3C7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9AD7ECBA-BF16-4FA1-BEB3-AE7FCEFC3C7B}.Release|Any CPU.Build.0 = Release|Any CPU
{C1A5F0B5-5E48-44E6-AE01-86FAFE676630}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C1A5F0B5-5E48-44E6-AE01-86FAFE676630}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C1A5F0B5-5E48-44E6-AE01-86FAFE676630}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C1A5F0B5-5E48-44E6-AE01-86FAFE676630}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -160,6 +179,8 @@ Global
{BEEEAE81-0CE8-48E9-AE58-D76C8C6C58C4} = {6AFB87A3-501B-4A87-B94C-205AEB118D97}
{228CC403-4FBE-4E4F-9B74-891F30A404E0} = {9818A770-01ED-4340-BD4A-CFDDA6C56168}
{837AA9C2-1682-4B0C-8B4D-0CBE42281E48} = {6AFB87A3-501B-4A87-B94C-205AEB118D97}
{AB4EC3F2-A116-439E-B715-78ED415A96CC} = {6AFB87A3-501B-4A87-B94C-205AEB118D97}
{C1A5F0B5-5E48-44E6-AE01-86FAFE676630} = {6AFB87A3-501B-4A87-B94C-205AEB118D97}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {89DA4AF5-B982-42AD-A829-8A72BCB21227}
Expand Down
28 changes: 28 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core

trigger:
- master
- develop

pool:
vmImage: 'ubuntu-latest'

variables:
buildConfiguration: 'Release'

steps:
- script: dotnet build Silverback.sln --configuration $(buildConfiguration)
displayName: 'dotnet build $(buildConfiguration)'
- script: dotnet test Silverback.sln --logger trx --collect "Code coverage" --filter CI!=false /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:Exclude="[xunit.*]*"
displayName: 'dotnet test'
- task: PublishTestResults@2
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx'
- task: PublishCodeCoverageResults@1
inputs:
summaryFileLocation: $(System.DefaultWorkingDirectory)/**/coverage.cobertura.xml
codecoverageTool: cobertura
Binary file modified graphics/Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/Icon2.psd
Binary file not shown.
81 changes: 56 additions & 25 deletions nuget/Update.ps1
Original file line number Diff line number Diff line change
@@ -1,26 +1,7 @@
$repositoryLocation = "."
[bool]$clearCache = $FALSE

foreach ($arg in $args)
{
if ($arg -eq "-c")
{
$clearCache = $TRUE
}
}

$buildConfiguration = "Debug"

$sources =
("Silverback.Core", "..\src\Silverback.Core\bin\$buildConfiguration"),
("Silverback.Core.EntityFrameworkCore", "..\src\Silverback.Core.EntityFrameworkCore\bin\$buildConfiguration"),
("Silverback.Core.Rx", "..\src\Silverback.Core.Rx\bin\$buildConfiguration"),
("Silverback.Core.Model", "..\src\Silverback.Core.Model\bin\$buildConfiguration"),
("Silverback.Integration", "..\src\Silverback.Integration\bin\$buildConfiguration"),
("Silverback.Integration.EntityFrameworkCore", "..\src\Silverback.Integration.EntityFrameworkCore\bin\$buildConfiguration"),
("Silverback.Integration.Kafka", "..\src\Silverback.Integration.Kafka\bin\$buildConfiguration"),
("Silverback.Integration.InMemory", "..\src\Silverback.Integration.InMemory\bin\$buildConfiguration"),
("Silverback.Integration.Configuration", "..\src\Silverback.Integration.Configuration\bin\$buildConfiguration")
[bool]$global:clearCache = $FALSE
[bool]$global:build = $TRUE
$global:buildConfiguration = "Release"

# function Check-Location()
# {
Expand All @@ -37,6 +18,54 @@ $sources =
# }
# }

function Check-Args([string[]]$argsArray)
{
For ($i=0; $i -le $argsArray.Length; $i++) {
$arg = $argsArray[$i]

if ($arg -eq "--configuration" -Or $arg -eq "-c")
{
$global:buildConfiguration = $argsArray[$i + 1]
}
elseif ($arg -eq "--clear-cache" -Or $arg -eq "-l")
{
$global:clearCache = $TRUE
}
elseif ($arg -eq "--no-build")
{
$global:build = $FALSE
}
}
}

function Get-Sources()
{
$sources =
("Silverback.Core", "..\src\Silverback.Core\bin\$global:buildConfiguration"),
("Silverback.Core.EntityFrameworkCore", "..\src\Silverback.Core.EntityFrameworkCore\bin\$global:buildConfiguration"),
("Silverback.Core.Rx", "..\src\Silverback.Core.Rx\bin\$global:buildConfiguration"),
("Silverback.Core.Model", "..\src\Silverback.Core.Model\bin\$global:buildConfiguration"),
("Silverback.Integration", "..\src\Silverback.Integration\bin\$global:buildConfiguration"),
("Silverback.Integration.EntityFrameworkCore", "..\src\Silverback.Integration.EntityFrameworkCore\bin\$global:buildConfiguration"),
("Silverback.Integration.Kafka", "..\src\Silverback.Integration.Kafka\bin\$global:buildConfiguration"),
("Silverback.Integration.InMemory", "..\src\Silverback.Integration.InMemory\bin\$global:buildConfiguration"),
("Silverback.Integration.Configuration", "..\src\Silverback.Integration.Configuration\bin\$global:buildConfiguration"),
("Silverback.EventSourcing", "..\src\Silverback.EventSourcing\bin\$global:buildConfiguration"),
("Silverback.EventSourcing.EntityFrameworkCore", "..\src\Silverback.EventSourcing.EntityFrameworkCore\bin\$global:buildConfiguration")

return $sources
}

function Build()
{
if ($global:build)
{
Write-Host "Building ($global:buildConfiguration)...`n" -ForegroundColor Yellow
dotnet build -c $global:buildConfiguration -v q ../Silverback.sln
Write-Host "" -ForegroundColor Yellow
}
}

function Delete-All()
{
Write-Host "Deleting everything in target folder..." -ForegroundColor Yellow -NoNewline
Expand All @@ -55,15 +84,15 @@ function Copy-All()

Write-Host "Copying packages..." -ForegroundColor Yellow

foreach ($source in $sources)
foreach ($source in Get-Sources)
{
$name = $source[0]
$sourcePath = Join-Path $source[1] "*.nupkg"

Copy-Package $name $sourcePath
}

if ($clearCache)
if ($global:clearCache)
{
Delete-Cache $name
}
Expand Down Expand Up @@ -112,7 +141,7 @@ function Show-Summary([string]$path)
Add-Version $file $hashtable
}

foreach ($source in $sources)
foreach ($source in Get-Sources)
{
$key = $source[0]

Expand Down Expand Up @@ -198,6 +227,8 @@ function Delete-Cache([string]$name)
dotnet nuget locals all --clear
}

Check-Args $args
# Check-Location
Build
Delete-All
Copy-All
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Silverback.Domain;
using Silverback.Background.Model;
using Silverback.EntityFrameworkCore;
using Silverback.Messaging.Connectors.Model;
using Silverback.Messaging.LargeMessages;
Expand All @@ -14,31 +14,24 @@ namespace Silverback.Examples.Common.Data
{
public class ExamplesDbContext : DbContext
{
private DbContextEventsPublisher<DomainEntity> _eventsPublisher;
private readonly DbContextEventsPublisher _eventsPublisher;

public ExamplesDbContext(IPublisher publisher)
{
InitEventsPublisher(publisher);
_eventsPublisher = new DbContextEventsPublisher(publisher, this);
}

public ExamplesDbContext(DbContextOptions options, IPublisher publisher)
: base(options)
{
InitEventsPublisher(publisher);
}

private void InitEventsPublisher(IPublisher publisher)
{
_eventsPublisher = new DbContextEventsPublisher<DomainEntity>(
DomainEntityEventsAccessor.EventsSelector,
DomainEntityEventsAccessor.ClearEventsAction,
publisher,
this);
_eventsPublisher = new DbContextEventsPublisher(publisher, this);
}

public DbSet<OutboundMessage> OutboundMessages { get; set; }
public DbSet<InboundMessage> InboundMessages { get; set; }
public DbSet<StoredOffset> StoredOffsets { get; set; }
public DbSet<Lock> Locks { get; set; }

public DbSet<Customer> Customers { get; set; }

protected override void OnModelCreating(ModelBuilder modelBuilder)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public static class DependencyInjectionHelper
public static IServiceCollection GetServiceCollection() => new ServiceCollection()
.AddDbContext<ExamplesDbContext>(options => options
.UseSqlServer(Configuration.ConnectionString))
.AddLogging(logging => logging.SetMinimumLevel(LogLevel.Trace))
.AddSingleton<JobScheduler>();
.AddLogging(logging => logging.SetMinimumLevel(LogLevel.Trace));
}
}
78 changes: 0 additions & 78 deletions samples/Examples/src/Silverback.Examples.Common/JobScheduler.cs

This file was deleted.

Loading

0 comments on commit 293ea5c

Please sign in to comment.