Skip to content

Commit b04f61f

Browse files
committed
Initial base idempotence implementation.
0 parents  commit b04f61f

30 files changed

+1033
-0
lines changed

.gitignore

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
.vs
2+
3+
# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
4+
[Bb]in/
5+
[Oo]bj/
6+
[Dd]eployment
7+
8+
# mstest test results
9+
TestResults
10+
11+
## Ignore Visual Studio temporary files, build results, and
12+
## files generated by popular Visual Studio add-ons.
13+
14+
# User-specific files
15+
*.suo
16+
*.user
17+
*.sln.docstates
18+
19+
# Build results
20+
[Dd]ebug/
21+
[Rr]elease/
22+
x64/
23+
*_i.c
24+
*_p.c
25+
*.ilk
26+
*.meta
27+
*.obj
28+
*.pch
29+
*.pdb
30+
*.pgc
31+
*.pgd
32+
*.rsp
33+
*.sbr
34+
*.tlb
35+
*.tli
36+
*.tlh
37+
*.tmp
38+
*.log
39+
*.vspscc
40+
*.vssscc
41+
.builds
42+
43+
# Visual C++ cache files
44+
ipch/
45+
*.aps
46+
*.ncb
47+
*.opensdf
48+
*.sdf
49+
50+
# Visual Studio profiler
51+
*.psess
52+
*.vsp
53+
*.vspx
54+
55+
# Guidance Automation Toolkit
56+
*.gpState
57+
58+
# ReSharper is a .NET coding add-in
59+
_ReSharper*/
60+
*.[Rr]e[Ss]harper
61+
*.DotSettings.user
62+
*.DotSettings
63+
64+
# NCrunch
65+
*.ncrunch*
66+
.*crunch*.local.xml
67+
68+
# Installshield output folder
69+
[Ee]xpress
70+
71+
# DocProject is a documentation generator add-in
72+
DocProject/buildhelp/
73+
DocProject/Help/*.HxT
74+
DocProject/Help/*.HxC
75+
DocProject/Help/*.hhc
76+
DocProject/Help/*.hhk
77+
DocProject/Help/*.hhp
78+
DocProject/Help/Html2
79+
DocProject/Help/html
80+
81+
# Click-Once directory
82+
publish
83+
84+
# Publish Web Output
85+
*.Publish.xml
86+
87+
# NuGet Packages Directory
88+
packages
89+
90+
# Windows Azure Build Output
91+
csx
92+
*.build.csdef
93+
94+
# Windows Store app package directory
95+
AppPackages/
96+
97+
# Others
98+
[Bb]in
99+
[Oo]bj
100+
sql
101+
TestResults
102+
[Tt]est[Rr]esult*
103+
*.Cache
104+
ClientBin
105+
[Ss]tyle[Cc]op.*
106+
~$*
107+
*.dbmdl
108+
Generated_Code #added for RIA/Silverlight projects
109+
110+
# Backup & report files from converting an old project file to a newer
111+
# Visual Studio version. Backup files are not needed, because we have git ;-)
112+
_UpgradeReport_Files/
113+
Backup*/
114+
UpgradeLog*.XML
115+
.vs/Shuttle.Esb.Sql.Idempotence/v15/Server/sqlite3/storage.ide

.media/logo.png

2.3 KB
Loading

LICENSE

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright (c) 2024, Eben Roux
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification,
5+
are permitted provided that the following conditions are met:
6+
7+
Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
10+
Redistributions in binary form must reproduce the above copyright notice, this
11+
list of conditions and the following disclaimer in the documentation and/or
12+
other materials provided with the distribution.
13+
14+
Neither the name of the Shuttle organization nor the names of its
15+
contributors may be used to endorse or promote products derived from
16+
this software without specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
22+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
25+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Idempotence
2+
3+
```
4+
PM> Install-Package Shuttle.Esb.Idempotence
5+
```
6+
7+
Contains an `IIdempotenceService` interface that should be implemented to provide idempotence support for the service bus.
8+
9+
## Configuration
10+
11+
```c#
12+
services.AddIdempotence();
13+
services.AddImplementedIdempotence();
14+
```
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System.Reflection;
2+
using System.Runtime.InteropServices;
3+
4+
#if NETSTANDARD
5+
[assembly: AssemblyTitle(".NET Standard")]
6+
#endif
7+
8+
#if NET6_0_OR_GREATER
9+
[assembly: AssemblyTitle(".NET Unified Platform")]
10+
#endif
11+
12+
[assembly: AssemblyVersion("#{SemanticVersionCore}#.0")]
13+
[assembly: AssemblyCopyright("Copyright (c) #{Year}#, Eben Roux")]
14+
[assembly: AssemblyProduct("Shuttle.Esb.Idempotence.Tests")]
15+
[assembly: AssemblyCompany("Eben Roux")]
16+
[assembly: AssemblyConfiguration("Release")]
17+
[assembly: AssemblyInformationalVersion("#{SemanticVersion}#")]
18+
[assembly: ComVisible(false)]
Binary file not shown.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<PackageTasksPath Condition="'$(PackageTasksPath)' == ''">Shuttle.NuGetPackager.MSBuild.dll</PackageTasksPath>
5+
</PropertyGroup>
6+
7+
<UsingTask AssemblyFile="$(PackageTasksPath)" TaskName="Shuttle.NuGetPackager.MSBuild.Prompt" />
8+
<UsingTask AssemblyFile="$(PackageTasksPath)" TaskName="Shuttle.NuGetPackager.MSBuild.RegexFindAndReplace" />
9+
<UsingTask AssemblyFile="$(PackageTasksPath)" TaskName="Shuttle.NuGetPackager.MSBuild.NuGet.SetNuGetPackageVersions" />
10+
<UsingTask AssemblyFile="$(PackageTasksPath)" TaskName="Shuttle.NuGetPackager.MSBuild.Zip" />
11+
<UsingTask AssemblyFile="$(PackageTasksPath)" TaskName="Shuttle.NuGetPackager.MSBuild.NuGet.SemanticVersion" />
12+
</Project>
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Version" ToolsVersion="15">
2+
<PropertyGroup>
3+
<PackageName>Shuttle.Esb.Idempotence.Tests</PackageName>
4+
<PackageSource Condition="$(PackageSource) == ''">https://www.nuget.org</PackageSource>
5+
<Configuration Condition="$(Configuration) == ''">Release</Configuration>
6+
</PropertyGroup>
7+
8+
<Import Project="Shuttle.NuGetPackager.targets" />
9+
10+
<ItemGroup>
11+
<ProjectReference Include="..\$(PackageName).csproj" />
12+
</ItemGroup>
13+
14+
<Target Name="Build">
15+
<MSBuild Projects="@(ProjectReference)" Targets="Rebuild" Properties="Configuration=Debug;Platform=AnyCPU" />
16+
<MSBuild Projects="@(ProjectReference)" Targets="Rebuild" Properties="Configuration=Release;Platform=AnyCPU" />
17+
</Target>
18+
19+
<Target Name="Version">
20+
<Prompt Text="Enter semantic version:" Condition="$(SemanticVersion) == ''">
21+
<Output TaskParameter="UserInput" PropertyName="SemanticVersion" />
22+
</Prompt>
23+
24+
<Error Text="Please enter a version number." Condition="$(SemanticVersion) == ''" />
25+
26+
<SemanticVersion Value="$(SemanticVersion)">
27+
<Output TaskParameter="VersionCore" PropertyName="SemanticVersionCore" />
28+
<Output TaskParameter="Prerelease" PropertyName="SemanticVersionPrerelease" />
29+
<Output TaskParameter="BuildMetadata" PropertyName="SemanticVersionBuildMetadata" />
30+
</SemanticVersion>
31+
32+
<Copy SourceFiles="AssemblyInfo.cs.template" DestinationFiles="..\Properties\AssemblyInfo.cs" SkipUnchangedFiles="false" />
33+
34+
<RegexFindAndReplace Files="..\Properties\AssemblyInfo.cs" FindExpression="#\{SemanticVersionCore\}#"
35+
ReplacementText="$(SemanticVersionCore)" />
36+
<RegexFindAndReplace Files="..\Properties\AssemblyInfo.cs" FindExpression="#\{SemanticVersion\}#"
37+
ReplacementText="$(SemanticVersion)" />
38+
<RegexFindAndReplace Files="..\Properties\AssemblyInfo.cs" FindExpression="#\{Year\}#"
39+
ReplacementText="$([System.DateTime]::Now.ToString(`yyyy`))" />
40+
41+
<Copy SourceFiles="package.nuspec.template" DestinationFiles="package.nuspec" SkipUnchangedFiles="false" />
42+
43+
<RegexFindAndReplace Files="package.nuspec" FindExpression="#\{SemanticVersion\}#"
44+
ReplacementText="$(SemanticVersion)" />
45+
<RegexFindAndReplace Files="package.nuspec" FindExpression="#\{Year\}#"
46+
ReplacementText="$([System.DateTime]::Now.ToString(`yyyy`))" />
47+
48+
<SetNuGetPackageVersions Files="package.nuspec" ProjectFile="..\$(PackageName).csproj" />
49+
</Target>
50+
51+
<Target Name="Pack" DependsOnTargets="Build">
52+
<Error
53+
Text="Before executing the 'Package' target first execute the 'Version' target to set the relevant semantic version in all applicable files."
54+
Condition="!Exists('package.nuspec')" />
55+
56+
<ItemGroup>
57+
<NuGetBinaries Include="..\bin\$(Configuration)\**\$(PackageName).dll" />
58+
</ItemGroup>
59+
60+
<RemoveDir Directories="release" />
61+
62+
<Copy SourceFiles="package.nuspec" DestinationFolder="release\" SkipUnchangedFiles="false" />
63+
<Copy SourceFiles="@(NuGetBinaries)" DestinationFolder="release\lib\%(RecursiveDir)" SkipUnchangedFiles="false" />
64+
65+
<Exec Command="nuget pack release\package.nuspec -OutputDirectory release -NoPackageAnalysis" />
66+
</Target>
67+
68+
<Target Name="Push" DependsOnTargets="Version">
69+
<MSBuild
70+
Projects="$(MSBuildProjectFile)"
71+
Targets="Pack"
72+
Properties="SemanticVersion=$(SemanticVersion)" />
73+
74+
<Exec
75+
Command="nuget push release\$(PackageName).$(SemanticVersion).nupkg -source $(PackageSource)" />
76+
</Target>
77+
78+
<Target Name="Bump" DependsOnTargets="Version">
79+
<MSBuild
80+
Projects="$(MSBuildProjectFile)"
81+
Targets="Pack"
82+
Properties="SemanticVersion=$(SemanticVersion)" />
83+
84+
<ItemGroup>
85+
<PackageFile Include="release\$(PackageName).*.nupkg" />
86+
</ItemGroup>
87+
88+
<MakeDir Directories="$(NuGetPackageSourceFolder)" Condition="$(NuGetPackageSourceFolder) != ''" />
89+
90+
<Copy
91+
SourceFiles="@(PackageFile)"
92+
DestinationFolder="$(NuGetPackageSourceFolder)"
93+
SkipUnchangedFiles="false"
94+
Condition="$(NuGetPackageSourceFolder) != ''" />
95+
</Target>
96+
97+
<Target Name="Flush">
98+
<ItemGroup>
99+
<PackageFolder Include="$(UserProfile)\.nuget\packages\$(PackageName)" />
100+
</ItemGroup>
101+
102+
<RemoveDir Directories="@(PackageFolder)" />
103+
</Target>
104+
</Project>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0"?>
2+
3+
<package>
4+
<metadata>
5+
<id>Shuttle.Esb.Idempotence.Tests</id>
6+
<version>20.0.0</version>
7+
<authors>Eben Roux</authors>
8+
<owners>Eben Roux</owners>
9+
<icon>images\logo.png</icon>
10+
<readme>docs\README.md</readme>
11+
<repository type="git" url="https://github.com/Shuttle/Shuttle.Esb.Sql.Idempotence.git" />
12+
<projectUrl>https://github.com/Shuttle/Shuttle.Esb.Sql.Idempotence</projectUrl>
13+
<description>Fixture for testing base idempotence implementations.</description>
14+
<copyright>Copyright (c) 2024, Eben Roux</copyright>
15+
<tags></tags>
16+
<dependencies>
17+
<dependency id="Microsoft.Extensions.Configuration.Json" version="8.0.1" />
18+
<dependency id="Microsoft.Extensions.DependencyInjection" version="8.0.1" />
19+
<dependency id="Microsoft.NET.Test.Sdk" version="17.12.0" />
20+
<dependency id="Moq" version="4.20.72" />
21+
<dependency id="NUnit" version="4.2.2" />
22+
<dependency id="NUnit3TestAdapter" version="4.6.0" />
23+
<dependency id="Shuttle.Esb.Logging" version="20.0.0" />
24+
<dependency id="Shuttle.Esb.Tests" version="20.0.0" />
25+
</dependencies>
26+
</metadata>
27+
<files>
28+
<file src="..\..\..\.media\logo.png" target="images" />
29+
<file src="..\..\..\README.md" target="docs" />
30+
<file src="lib\**\*.*" target="lib" />
31+
</files>
32+
</package>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0"?>
2+
3+
<package>
4+
<metadata>
5+
<id>Shuttle.Esb.Idempotence.Tests</id>
6+
<version>#{SemanticVersion}#</version>
7+
<authors>Eben Roux</authors>
8+
<owners>Eben Roux</owners>
9+
<icon>images\logo.png</icon>
10+
<readme>docs\README.md</readme>
11+
<repository type="git" url="https://github.com/Shuttle/Shuttle.Esb.Idempotence.git" />
12+
<projectUrl>https://github.com/Shuttle/Shuttle.Esb.Idempotence</projectUrl>
13+
<description>Fixture for testing base idempotence implementations.</description>
14+
<copyright>Copyright (c) #{Year}#, Eben Roux</copyright>
15+
<tags></tags>
16+
<dependencies>
17+
#{Dependencies}#
18+
</dependencies>
19+
</metadata>
20+
<files>
21+
<file src="..\..\..\.media\logo.png" target="images" />
22+
<file src="..\..\..\README.md" target="docs" />
23+
<file src="lib\**\*.*" target="lib" />
24+
</files>
25+
</package>

0 commit comments

Comments
 (0)