MSMQ in .NET 6

Nikhil Kumar 21 Reputation points
2022-07-22T11:13:38.573+00:00

In.NET 6 (C# 10), I'm creating a console/worker service. In order to store and retrieve messages, I intend to use Microsoft Message Queuing. Like when one service queues up a message and another service retrieves it from the queue. Recently, I read that MSMQ would no longer be supported in.net core. Is it real? any additional service we might utilize for the same purpose (other than Azure).

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,616 questions
.NET CLI
.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
337 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 66,706 Reputation points
    2022-07-22T16:28:15.517+00:00

    as MSMQ is a windows only feature, so can not be converted to .netstandard, nor has it been ported to .net core. Although there is no official statement, it appears to be dead. see:

    https://github.com/dotnet/runtime/issues/16409#issuecomment-541875447

    if you need to use it, my recommendation is create .net 4.8 webapi wrapper to MSMQ and use a web hooks approach.

    for a non cloud solution, rabbitmq is the most popular:

    https://www.rabbitmq.com

    you might want to look a sql server broker services, it probably has the features you need:

    https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-service-broker?view=sql-server-ver16


  2. Dennis van der Stelt 0 Reputation points
    2024-01-08T09:01:50.92+00:00

    I work for Particular Software and years ago we created a blogpost on the question whether or not MSMQ is dead.

    The SQL Server broker is a solution, but has some downsides, which I won't go into. It's the reason why NServiceBus has its own implementation for a SQL Server transport using regular tables. In other words, use NServiceBus on MSMQ, RabbitMQ, Azure Service Bus or SQL Server, you won't really know the difference if you're writing message handlers using NServiceBus.

    For migrating from one transport (like MSMQ) to another (like SQL Server) you can use the messaging bridge.

    If you have any question, feel free to comment here or drop me an email at support@particular.net

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.