diff --git a/scripts/install-dev b/scripts/install-dev index aac7cea..38ad223 100755 --- a/scripts/install-dev +++ b/scripts/install-dev @@ -4,7 +4,7 @@ dotnet pack ./src if dotnet new -l | grep MassTransit; then - dotnet new --uninstall MassTransit.Templates + dotnet new uninstall MassTransit.Templates fi -dotnet new --install ./src/bin/Debug/MassTransit.Templates.1.0.5.nupkg \ No newline at end of file +dotnet new install ./src/bin/Release/MassTransit.Templates.1.0.7.nupkg \ No newline at end of file diff --git a/scripts/uninstall-dev b/scripts/uninstall-dev index 5ac08c4..adc866f 100755 --- a/scripts/uninstall-dev +++ b/scripts/uninstall-dev @@ -1,4 +1,4 @@ #!/bin/bash -dotnet new --uninstall MassTransit.Templates -dotnet new --install MassTransit.Templates \ No newline at end of file +dotnet new uninstall MassTransit.Templates +dotnet new install MassTransit.Templates \ No newline at end of file diff --git a/src/Content/Consumer/Consumers/MessageNameConsumerDefinition.cs b/src/Content/Consumer/Consumers/MessageNameConsumerDefinition.cs index 28dd104..2157e70 100644 --- a/src/Content/Consumer/Consumers/MessageNameConsumerDefinition.cs +++ b/src/Content/Consumer/Consumers/MessageNameConsumerDefinition.cs @@ -5,9 +5,11 @@ namespace Company.Consumers public class MessageNameConsumerDefinition : ConsumerDefinition { - protected override void ConfigureConsumer(IReceiveEndpointConfigurator endpointConfigurator, IConsumerConfigurator consumerConfigurator) + protected override void ConfigureConsumer(IReceiveEndpointConfigurator endpointConfigurator, IConsumerConfigurator consumerConfigurator, IRegistrationContext context) { endpointConfigurator.UseMessageRetry(r => r.Intervals(500, 1000)); + + endpointConfigurator.UseInMemoryOutbox(context); } } } \ No newline at end of file diff --git a/src/Content/MassTransit.Docker/Dockerfile b/src/Content/MassTransit.Docker/Dockerfile index 8d05e2d..a923b9a 100644 --- a/src/Content/MassTransit.Docker/Dockerfile +++ b/src/Content/MassTransit.Docker/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src COPY ["MassTransit.Docker.csproj", "MassTransit.Docker/"] RUN dotnet restore "MassTransit.Docker/MassTransit.Docker.csproj" @@ -6,7 +6,7 @@ RUN dotnet restore "MassTransit.Docker/MassTransit.Docker.csproj" COPY . MassTransit.Docker/. RUN dotnet publish -c Release -o /app MassTransit.Docker/MassTransit.Docker.csproj -FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS publish +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS publish WORKDIR /app COPY --from=build /app ./ ENTRYPOINT ["dotnet", "MassTransit.Docker.dll"] \ No newline at end of file diff --git a/src/Content/MassTransit.Docker/MassTransit.Docker.csproj b/src/Content/MassTransit.Docker/MassTransit.Docker.csproj index 656185e..b94861f 100644 --- a/src/Content/MassTransit.Docker/MassTransit.Docker.csproj +++ b/src/Content/MassTransit.Docker/MassTransit.Docker.csproj @@ -1,13 +1,13 @@ - net6.0 - 9.0 + net8.0 + 11 - - - + + + diff --git a/src/Content/MassTransit.Docker/Program.cs b/src/Content/MassTransit.Docker/Program.cs index 5a15484..850c59f 100644 --- a/src/Content/MassTransit.Docker/Program.cs +++ b/src/Content/MassTransit.Docker/Program.cs @@ -11,11 +11,6 @@ namespace MassTransit.Docker { public class Program { - static bool? _isRunningInContainer; - - static bool IsRunningInContainer => - _isRunningInContainer ??= bool.TryParse(Environment.GetEnvironmentVariable("DOTNET_RUNNING_IN_CONTAINER"), out var inContainer) && inContainer; - public static async Task Main(string[] args) { await CreateHostBuilder(args).Build().RunAsync(); @@ -44,9 +39,6 @@ public static IHostBuilder CreateHostBuilder(string[] args) => x.UsingRabbitMq((context, cfg) => { - if (IsRunningInContainer) - cfg.Host("rabbitmq"); - cfg.UseDelayedMessageScheduler(); cfg.ConfigureEndpoints(context); diff --git a/src/Content/MassTransit.Worker/MassTransit.Worker.csproj b/src/Content/MassTransit.Worker/MassTransit.Worker.csproj index b3c558b..9406276 100644 --- a/src/Content/MassTransit.Worker/MassTransit.Worker.csproj +++ b/src/Content/MassTransit.Worker/MassTransit.Worker.csproj @@ -1,12 +1,12 @@ - net6.0 - 9.0 + net8.0 + 11 - - + + diff --git a/src/Content/StateMachine/StateMachines/MachineNameStateMachine.cs b/src/Content/StateMachine/StateMachines/MachineNameStateMachine.cs index 76f45bb..cce7e5c 100644 --- a/src/Content/StateMachine/StateMachines/MachineNameStateMachine.cs +++ b/src/Content/StateMachine/StateMachines/MachineNameStateMachine.cs @@ -14,7 +14,7 @@ public MachineNameStateMachine() Initially( When(MachineNameEvent) - .Then(context => context.Instance.Value = context.Data.Value) + .Then(context => context.Saga.Value = context.Message.Value) .TransitionTo(Created) ); diff --git a/src/Content/StateMachine/StateMachines/MachineNameStateSagaDefinition.cs b/src/Content/StateMachine/StateMachines/MachineNameStateSagaDefinition.cs index 5b1b4a0..ec8f910 100644 --- a/src/Content/StateMachine/StateMachines/MachineNameStateSagaDefinition.cs +++ b/src/Content/StateMachine/StateMachines/MachineNameStateSagaDefinition.cs @@ -5,10 +5,11 @@ namespace Company.StateMachines public class MachineNameStateSagaDefinition : SagaDefinition { - protected override void ConfigureSaga(IReceiveEndpointConfigurator endpointConfigurator, ISagaConfigurator sagaConfigurator) + protected override void ConfigureSaga(IReceiveEndpointConfigurator endpointConfigurator, ISagaConfigurator sagaConfigurator, IRegistrationContext context) { endpointConfigurator.UseMessageRetry(r => r.Intervals(500, 1000)); - endpointConfigurator.UseInMemoryOutbox(); + + endpointConfigurator.UseInMemoryOutbox(context); } } } \ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 0e9f6a2..73b94dc 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,7 +1,7 @@ - 1.0.6 + 1.0.7 false $(NoWarn);NU5105 https://github.com/MassTransit/MassTransit-Templates diff --git a/src/MassTransit.Templates.csproj b/src/MassTransit.Templates.csproj index 8decdef..e66c74f 100644 --- a/src/MassTransit.Templates.csproj +++ b/src/MassTransit.Templates.csproj @@ -19,6 +19,6 @@ - + \ No newline at end of file