Skip to content

Commit

Permalink
Simplify MassTransit sample
Browse files Browse the repository at this point in the history
  • Loading branch information
stidsborg committed Aug 30, 2024
1 parent 442801c commit 22d2f70
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

<ItemGroup>
<ProjectReference Include="..\..\..\Cleipnir.Flows\Cleipnir.Flows.csproj" />
<ProjectReference Include="..\..\..\SourceGeneration\Cleipnir.Flows.SourceGenerator\Cleipnir.Flows.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ private static IHostBuilder CreateHostBuilder(string[] args) =>
{
services.AddFlows(c => c
.UseInMemoryStore()
.RegisterFlow<SimpleFlow, SimpleFlows>()
//.RegisterFlowsAutomatically()
.RegisterFlowsAutomatically()
);

services.AddMassTransit(x =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Cleipnir.ResilientFunctions.Reactive.Extensions;
using MassTransit;

namespace Cleipnir.Flows.MassTransit.Console;

Expand All @@ -9,4 +10,10 @@ public override async Task Run()
var msg = await Messages.FirstOfType<MyMessage>();
System.Console.WriteLine($"SimpleFlow({msg}) executed");
}
}
}

public class SimpleFlowsHandler(SimpleFlows simpleFlows) : IConsumer<MyMessage>
{
public Task Consume(ConsumeContext<MyMessage> context)
=> simpleFlows.SendMessage(context.Message.Value, context.Message);
}

This file was deleted.

This file was deleted.

0 comments on commit 22d2f70

Please sign in to comment.