From 3a01c16bb8c2a6aedd2a2e667d29f5c79c14ef40 Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 23 Sep 2024 10:37:52 -0600 Subject: [PATCH] Masstransit messages sample doco review (#6846) * Masstransit messages sample doco review * Add net48 to NSB 7 sample * Make NSB 8 and 9 samples use Quorum queues * add net48 to NSB 7 sample - in all projects * Update samples/pipeline/masstransit-messages/Core_8/NServiceBusSubscriber/Program.cs * Update sample.md --- .../Core_7/MTEndpoint/MTEndpoint.csproj | 2 +- .../masstransit-messages/Core_7/Messages/Messages.csproj | 2 +- .../NServiceBusSubscriber/NServiceBusSubscriber.csproj | 2 +- .../Core_8/NServiceBusSubscriber/Program.cs | 2 +- .../Core_9/NServiceBusSubscriber/Program.cs | 2 +- samples/pipeline/masstransit-messages/sample.md | 8 +++++++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/samples/pipeline/masstransit-messages/Core_7/MTEndpoint/MTEndpoint.csproj b/samples/pipeline/masstransit-messages/Core_7/MTEndpoint/MTEndpoint.csproj index bc12e0d80f8..6bc3fe3231f 100644 --- a/samples/pipeline/masstransit-messages/Core_7/MTEndpoint/MTEndpoint.csproj +++ b/samples/pipeline/masstransit-messages/Core_7/MTEndpoint/MTEndpoint.csproj @@ -1,6 +1,6 @@ - net8.0;net6.0 + net8.0;net6.0;net48 dotnet-MTEndpoint-0796FBA1-1278-479A-94F8-C8918B42B338 10.0 diff --git a/samples/pipeline/masstransit-messages/Core_7/Messages/Messages.csproj b/samples/pipeline/masstransit-messages/Core_7/Messages/Messages.csproj index 91d84fab94f..66de7fc2544 100644 --- a/samples/pipeline/masstransit-messages/Core_7/Messages/Messages.csproj +++ b/samples/pipeline/masstransit-messages/Core_7/Messages/Messages.csproj @@ -1,6 +1,6 @@ - net8.0;net6.0 + net8.0;net6.0;net48 10.0 \ No newline at end of file diff --git a/samples/pipeline/masstransit-messages/Core_7/NServiceBusSubscriber/NServiceBusSubscriber.csproj b/samples/pipeline/masstransit-messages/Core_7/NServiceBusSubscriber/NServiceBusSubscriber.csproj index 5c1448a2cdb..823856ca08e 100644 --- a/samples/pipeline/masstransit-messages/Core_7/NServiceBusSubscriber/NServiceBusSubscriber.csproj +++ b/samples/pipeline/masstransit-messages/Core_7/NServiceBusSubscriber/NServiceBusSubscriber.csproj @@ -1,6 +1,6 @@ - net8.0;net6.0 + net8.0;net6.0;net48 dotnet-NServiceBusSubscriber-573F9BD8-FB1A-4A4C-BC88-E4A997A00BE2 10.0 diff --git a/samples/pipeline/masstransit-messages/Core_8/NServiceBusSubscriber/Program.cs b/samples/pipeline/masstransit-messages/Core_8/NServiceBusSubscriber/Program.cs index f116a5720a8..2162f6a52f3 100644 --- a/samples/pipeline/masstransit-messages/Core_8/NServiceBusSubscriber/Program.cs +++ b/samples/pipeline/masstransit-messages/Core_8/NServiceBusSubscriber/Program.cs @@ -27,7 +27,7 @@ public static IHostBuilder CreateHostBuilder(string[] args) #region Transport var transport = endpointConfiguration.UseTransport(); transport.ConnectionString("host=localhost;username=guest;password=guest"); - transport.UseConventionalRoutingTopology(QueueType.Classic); + transport.UseConventionalRoutingTopology(QueueType.Quorum); #endregion #region Serializer diff --git a/samples/pipeline/masstransit-messages/Core_9/NServiceBusSubscriber/Program.cs b/samples/pipeline/masstransit-messages/Core_9/NServiceBusSubscriber/Program.cs index 7f88c3d1f1b..2d3583d6997 100644 --- a/samples/pipeline/masstransit-messages/Core_9/NServiceBusSubscriber/Program.cs +++ b/samples/pipeline/masstransit-messages/Core_9/NServiceBusSubscriber/Program.cs @@ -20,7 +20,7 @@ public static void Main(string[] args) #region Transport var transport = endpointConfiguration.UseTransport(); transport.ConnectionString("host=localhost;username=guest;password=guest"); - transport.UseConventionalRoutingTopology(QueueType.Classic); + transport.UseConventionalRoutingTopology(QueueType.Quorum); #endregion #region Serializer diff --git a/samples/pipeline/masstransit-messages/sample.md b/samples/pipeline/masstransit-messages/sample.md index 52f2743e694..c4db1962438 100644 --- a/samples/pipeline/masstransit-messages/sample.md +++ b/samples/pipeline/masstransit-messages/sample.md @@ -1,7 +1,7 @@ --- title: Consuming MassTransit messages with NServiceBus summary: Use the NServiceBus pipeline to consume messages sent by MassTransit. -reviewed: 2021-11-04 +reviewed: 2024-09-22 component: Core related: - nservicebus/pipeline @@ -16,6 +16,12 @@ downloadbutton This sample requires a local instance of RabbitMQ. +The easiest way to do this is to run RabbitMQ in Docker by running the following command + +```shell +docker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management +``` + ## Message structure comparison When using a message structured like this: