-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
1,309 additions
and
61 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
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 was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
src/Duracellko.PlanningPoker.RabbitMQ/Duracellko.PlanningPoker.RabbitMQ.csproj
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,34 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Configuration)'=='Release'"> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="RabbitMQ.Client" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Duracellko.PlanningPoker.Azure\Duracellko.PlanningPoker.Azure.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Update="Resources.Designer.cs"> | ||
<DesignTime>True</DesignTime> | ||
<AutoGen>True</AutoGen> | ||
<DependentUpon>Resources.resx</DependentUpon> | ||
</Compile> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<EmbeddedResource Update="Resources.resx"> | ||
<Generator>ResXFileCodeGenerator</Generator> | ||
<LastGenOutput>Resources.Designer.cs</LastGenOutput> | ||
</EmbeddedResource> | ||
</ItemGroup> | ||
|
||
</Project> |
41 changes: 41 additions & 0 deletions
41
src/Duracellko.PlanningPoker.RabbitMQ/IMessageConverter.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,41 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Duracellko.PlanningPoker.Azure; | ||
|
||
namespace Duracellko.PlanningPoker.RabbitMQ; | ||
|
||
/// <summary> | ||
/// When implemented, then object is able to convert messages of type <see cref="T:NodeMessage"/> to RabbitMQ message and vice versa. | ||
/// </summary> | ||
public interface IMessageConverter | ||
{ | ||
/// <summary> | ||
/// Gets headers of RabbitMQ message converted from <see cref="T:NodeMessage"/>. | ||
/// </summary> | ||
/// <param name="message">The message to convert.</param> | ||
/// <returns>Headers of the message.</returns> | ||
IDictionary<string, object> GetMessageHeaders(NodeMessage message); | ||
|
||
/// <summary> | ||
/// Gets body of RabbitMQ message converted from <see cref="T:NodeMessage"/>. | ||
/// </summary> | ||
/// <param name="message">The message to convert.</param> | ||
/// <returns>Body of the message.</returns> | ||
ReadOnlyMemory<byte> GetMessageBody(NodeMessage message); | ||
|
||
/// <summary> | ||
/// Converts RabbitMQ message headers and body to <see cref="T:NodeMessage"/> object. | ||
/// </summary> | ||
/// <param name="headers">Headers of the message to convert.</param> | ||
/// <param name="body">Body of the message to convert.</param> | ||
/// <returns>Converted message of NodeMessage type.</returns> | ||
NodeMessage GetNodeMessage(IDictionary<string, object> headers, ReadOnlyMemory<byte> body); | ||
|
||
/// <summary> | ||
/// Gets decoded value of Rabbit MQ message header with specified key. | ||
/// </summary> | ||
/// <param name="headers">The collection of header key-value pairs.</param> | ||
/// <param name="key">The key to get header value for.</param> | ||
/// <returns>Value header with specified key.</returns> | ||
string? GetHeader(IDictionary<string, object> headers, string key); | ||
} |
Oops, something went wrong.