Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit MassTransit v7 support to 7.1.0 and higher #2024

Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,10 @@ SPDX-License-Identifier: Apache-2.0

<tracerFactory name="TransportConfigLegacyWrapper">

<!--This classname works for MassTransit v7.0.0-->
<match assemblyName="MassTransit" className="MassTransit.Registration.TransportRegistrationBusFactory" maxVersion="8.0.0">
<match assemblyName="MassTransit" className="MassTransit.Registration.TransportRegistrationBusFactory`1" minVersion="7.1.0" maxVersion="8.0.0">
<exactMethodMatcher methodName="CreateBus" />
</match>
<!--This classname works for MassTransit v7.3.1-->
<match assemblyName="MassTransit" className="MassTransit.Registration.TransportRegistrationBusFactory`1" maxVersion="8.0.0">
<exactMethodMatcher methodName="CreateBus" />
</match>

<match assemblyName="MassTransit" className="MassTransit.BusFactoryExtensions" maxVersion="8.0.0">
<match assemblyName="MassTransit" className="MassTransit.BusFactoryExtensions" minVersion="7.1.0" maxVersion="8.0.0">
<exactMethodMatcher methodName="Build" parameters="MassTransit.IBusFactory,MassTransit.Configuration.IBusConfiguration,System.Collections.Generic.IEnumerable`1[GreenPipes.ValidationResult]" />
</match>
</tracerFactory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ namespace MultiFunctionApplicationHelpers
public static class ConsoleMFLogger
{

private static string LogTs => DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss,fff");

private static int Tid = System.Threading.Thread.CurrentThread.ManagedThreadId;
nr-ahemsath marked this conversation as resolved.
Show resolved Hide resolved

public static void Info()
{
Info("");
Expand All @@ -18,7 +22,7 @@ public static void Info(params string[] message)
{
foreach (var msg in message)
{
Console.WriteLine($"{DateTime.Now.ToLongTimeString()} :{msg}");
Console.WriteLine($"{LogTs} tid:{Tid} {msg}");
}
}

Expand All @@ -31,13 +35,14 @@ public static void Error(params string[] message)
{
foreach (var msg in message)
{
Console.Error.WriteLine($"{DateTime.Now.ToLongTimeString()} :{msg}");
Console.Error.WriteLine($"{LogTs} tid:{Tid} {msg}");
}
}

public static void Error(Exception ex)
{
Error(ex.ToString());
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -264,20 +264,21 @@

<!--MassTransit-->
<ItemGroup>
<PackageReference Include="MassTransit" Version="7.3.1" Condition="'$(TargetFramework)' == 'net462'" />
<PackageReference Include="MassTransit" Version="7.3.1" Condition="'$(TargetFramework)' == 'net471'" />

<PackageReference Include="MassTransit" Version="7.1.0" Condition="'$(TargetFramework)' == 'net462'" />
<PackageReference Include="MassTransit" Version="7.1.0" Condition="'$(TargetFramework)' == 'net471'" />
<PackageReference Include="MassTransit" Version="7.3.1" Condition="'$(TargetFramework)' == 'net48'" />
<PackageReference Include="MassTransit" Version="8.1.1" Condition="'$(TargetFramework)' == 'net481'" />
<PackageReference Include="MassTransit" Version="7.3.1" Condition="'$(TargetFramework)' == 'net6.0'" />
<PackageReference Include="MassTransit" Version="8.1.1" Condition="'$(TargetFramework)' == 'net7.0'" />

<PackageReference Include="MassTransit.AspNetCore" Version="7.3.1" Condition="'$(TargetFramework)' == 'net462'" />
<PackageReference Include="MassTransit.AspNetCore" Version="7.3.1" Condition="'$(TargetFramework)' == 'net471'" />
<PackageReference Include="MassTransit.AspNetCore" Version="7.1.0" Condition="'$(TargetFramework)' == 'net462'" />
<PackageReference Include="MassTransit.AspNetCore" Version="7.1.0" Condition="'$(TargetFramework)' == 'net471'" />
<PackageReference Include="MassTransit.AspNetCore" Version="7.3.1" Condition="'$(TargetFramework)' == 'net48'" />
<PackageReference Include="MassTransit.AspNetCore" Version="7.3.1" Condition="'$(TargetFramework)' == 'net6.0'" />

<PackageReference Include="MassTransit.Extensions.DependencyInjection" Version="7.3.1" Condition="'$(TargetFramework)' == 'net462'" />
<PackageReference Include="MassTransit.Extensions.DependencyInjection" Version="7.3.1" Condition="'$(TargetFramework)' == 'net471'" />
<PackageReference Include="MassTransit.Extensions.DependencyInjection" Version="7.1.0" Condition="'$(TargetFramework)' == 'net462'" />
<PackageReference Include="MassTransit.Extensions.DependencyInjection" Version="7.1.0" Condition="'$(TargetFramework)' == 'net471'" />
<PackageReference Include="MassTransit.Extensions.DependencyInjection" Version="7.3.1" Condition="'$(TargetFramework)' == 'net48'" />
<PackageReference Include="MassTransit.Extensions.DependencyInjection" Version="7.3.1" Condition="'$(TargetFramework)' == 'net6.0'" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ public async Task StopBus()
[LibraryMethod]
[Transaction]
[MethodImpl(MethodImplOptions.NoOptimization | MethodImplOptions.NoInlining)]
public async Task Publish(string message)
public async Task Publish(string text)
{
var order = new Message() { Text = message };
await _bus.Publish(order);
ConsoleMFLogger.Info($"Published message {message}");
var message = new Message() { Text = text };
await _bus.Publish(message);
ConsoleMFLogger.Info($"Published message {text}");

// This sleep ensures that this transaction method is the one sampled for transaction trace data
Thread.Sleep(1000);
Expand Down
Loading