Skip to content

Commit

Permalink
Updated packages, templates, and MT version.
Browse files Browse the repository at this point in the history
  • Loading branch information
phatboyg committed Aug 13, 2024
1 parent 75ad87d commit f73223f
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 29 deletions.
4 changes: 2 additions & 2 deletions scripts/install-dev
Original file line number Diff line number Diff line change
Expand Up @@ -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
dotnet new install ./src/bin/Release/MassTransit.Templates.1.0.7.nupkg
4 changes: 2 additions & 2 deletions scripts/uninstall-dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

dotnet new --uninstall MassTransit.Templates
dotnet new --install MassTransit.Templates
dotnet new uninstall MassTransit.Templates
dotnet new install MassTransit.Templates
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ namespace Company.Consumers
public class MessageNameConsumerDefinition :
ConsumerDefinition<MessageNameConsumer>
{
protected override void ConfigureConsumer(IReceiveEndpointConfigurator endpointConfigurator, IConsumerConfigurator<MessageNameConsumer> consumerConfigurator)
protected override void ConfigureConsumer(IReceiveEndpointConfigurator endpointConfigurator, IConsumerConfigurator<MessageNameConsumer> consumerConfigurator, IRegistrationContext context)
{
endpointConfigurator.UseMessageRetry(r => r.Intervals(500, 1000));

endpointConfigurator.UseInMemoryOutbox(context);
}
}
}
4 changes: 2 additions & 2 deletions src/Content/MassTransit.Docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
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"

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"]
10 changes: 5 additions & 5 deletions src/Content/MassTransit.Docker/MassTransit.Docker.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Worker">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>9.0</LangVersion>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>11</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
<PackageReference Include="MassTransit" Version="[8.0.0,9.0)" />
<PackageReference Include="MassTransit.RabbitMQ" Version="[8.0.0,9.0)" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="MassTransit" Version="[8.*,9.0)" />
<PackageReference Include="MassTransit.RabbitMQ" Version="[8.*,9.0)" />
</ItemGroup>
</Project>
8 changes: 0 additions & 8 deletions src/Content/MassTransit.Docker/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -44,9 +39,6 @@ public static IHostBuilder CreateHostBuilder(string[] args) =>

x.UsingRabbitMq((context, cfg) =>
{
if (IsRunningInContainer)
cfg.Host("rabbitmq");

cfg.UseDelayedMessageScheduler();

cfg.ConfigureEndpoints(context);
Expand Down
8 changes: 4 additions & 4 deletions src/Content/MassTransit.Worker/MassTransit.Worker.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.Worker">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>9.0</LangVersion>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>11</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
<PackageReference Include="MassTransit" Version="[8.0.0,9.0)" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="MassTransit" Version="[8.*,9.0)" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -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)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ namespace Company.StateMachines
public class MachineNameStateSagaDefinition :
SagaDefinition<MachineNameState>
{
protected override void ConfigureSaga(IReceiveEndpointConfigurator endpointConfigurator, ISagaConfigurator<MachineNameState> sagaConfigurator)
protected override void ConfigureSaga(IReceiveEndpointConfigurator endpointConfigurator, ISagaConfigurator<MachineNameState> sagaConfigurator, IRegistrationContext context)
{
endpointConfigurator.UseMessageRetry(r => r.Intervals(500, 1000));
endpointConfigurator.UseInMemoryOutbox();

endpointConfigurator.UseInMemoryOutbox(context);
}
}
}
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Version>1.0.6</Version>
<Version>1.0.7</Version>
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
<NoWarn>$(NoWarn);NU5105</NoWarn>
<RepositoryUrl>https://github.com/MassTransit/MassTransit-Templates</RepositoryUrl>
Expand Down
2 changes: 1 addition & 1 deletion src/MassTransit.Templates.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<Compile Remove="**\*" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>
</Project>

0 comments on commit f73223f

Please sign in to comment.