Questions tagged [masstransit]

MassTransit is a free, open source, lightweight service bus for the Microsoft .NET framework.

MassTransit is a free, open source, lightweight service bus for the Microsoft .NET framework.

It supports a number of different transports:

  • RabbitMQ
  • Azure Service Bus
  • Amazon MQ / Active MQ
  • Amazon SQS/SNS

Several saga storage engines, including:

  • SQL (Entity Framework or NHibernate)
  • MongoDB
  • Redis
  • Postgres (via Marten)
  • Cosmos DB

MassTransit also supports Quartz.NET and Hangfire for message scheduling.

MassTransit is hosted on GitHub, has online Documentation and a Discord Server for community support.

1993 questions
12
votes
1 answer

Difference between Handler and Consumer in MassTransit

What is the difference between a Handler and a Consumer in MassTransit? I've seen examples that use one or the other, but conceptually, I'm unclear on what the difference is between the two and why you would want to choose one or the other.
Remi Despres-Smyth
  • 4,173
  • 3
  • 36
  • 46
12
votes
1 answer

MassTransit and event versus command publishing

I'm new to MassTransit, and I miss something in my understanding. Let's say I have a server farm were all nodes can do the same job. The application framework is CQRS's styled. That means I have two base kind of message to publish : Commands : must…
Steve B
  • 36,818
  • 21
  • 101
  • 174
11
votes
1 answer

How to implement a competing consumer solution?

As a exercise I'm trying to find an example which implements competing consumer. many producers - > MSMQueue <- competing consumers So far I did not find any documentation on how to achieve this. My first attempt to figure out how is implemented…
ruslander
  • 3,815
  • 4
  • 32
  • 34
11
votes
1 answer

Masstransit EndpointConvention Azure Service Bus

I'm wondering if I'm doing something wrong, I expected MassTransit would automatically register ReceiveEndpoints in the EndpointConvention. Sample code: services.AddMassTransit(x => { x.AddServiceBusMessageScheduler(); …
Stephan
  • 2,356
  • 16
  • 38
11
votes
1 answer

MassTransit Interoperability with non-.NET services

I have been using MassTransit and really like it. However, by default, it wraps all RabbitMQ payloads/messages with some JSON specific to MassTransit. This makes it difficult to exchange messages with non-.NET services. I know that JSON can be…
Andy
  • 2,709
  • 5
  • 37
  • 64
11
votes
1 answer

Masstransit - No messages added to MSMQ when receiver service isn't started

My application consists of an ASP.NET MVC 3 application and a Windows Service, both on the same box. The MVC application uses MassTransit to place messages on an MSMQ queue. The service uses MassTransit to read these messages from MSMQ and perform…
JP.
  • 5,536
  • 7
  • 58
  • 100
10
votes
2 answers

Can we use RabbitMQ and Mediatr together using masstransit?

I created a microservice application that microservices using MassTransit and RabbitMQ for communication. Each microservice developed using clean architecture, so we have MediatR inside each microservice. Is it possible to use MassTransit for inside…
Mahdi
  • 725
  • 2
  • 7
  • 24
10
votes
0 answers

The agent is stopped or has been stopped, no additional provocateurs can be created

Every once in a while, I start to see the following exception. I'm not sure how to fix it, or why does the app think it's stopping. The only way to fix it is to restart the app. What is the best practice for this error? What is the reason for this…
Ahmet
  • 906
  • 1
  • 8
  • 22
10
votes
2 answers

How to register a generic consumer adapter in MassTransit if I have a list of message types

I am successfully using MassTransit for a silly sample application where I publish an message (an event) from a Publisher console application and I receive it at two different consumers which are also console applications using RabbitMq. This is the…
diegosasw
  • 13,734
  • 16
  • 95
  • 159
10
votes
3 answers

Publish message using exchange and routing key using MassTransit

I've been looking at MassTransit for a couple of weeks now and I'm curious about the possibilities. However, I don't seem to be able to get the concepts quite right. Expected behaviour I wanted to publish message to "direct" exchange with routing…
Syed
  • 417
  • 1
  • 6
  • 13
10
votes
2 answers

Masstransit use RabbitMQ is very slow performance?

I used RabbitMQ without Masstransit and send 10,000 message/per sec and One million message in 100 second. But after using Masstransit with RabbitMQ the performance is very low in my machine. The hard disk is very active (99% usage) when…
10
votes
1 answer

Newbie - Is a Consumer Queue necessary in order for Publishing to work in MassTransit

I am trying to get my head around MassTransit and RabbitMQ and queuing (day 1) The question I have is whether a "Consumer is necessary in order for queuing to work in MT. The reason I ask is because I first created Domain and Producer but I didn't…
TheMar
  • 1,934
  • 2
  • 30
  • 51
9
votes
1 answer

How to authenticate a user when consuming MassTransit messages in Asp.Net Core Web API?

I have several Asp.Net Core Web APIs that use Bearer authentication and IdentityServer4.AccessTokenValidation middleware to introspect tokens, authenticate the user and create claims. This works fine for HTTP requests. I am in the process of…
Gavin Sutherland
  • 1,666
  • 3
  • 23
  • 36
9
votes
1 answer

How to use MassTransit test harness to test Consumer with constructor dependency injection?

I have some message consumers that take dependencies through the constructor, and I would like to cover them in unit tests. Does MassTransit's test harness provide a way to register consumers with constructor parameters?
RAM
  • 2,257
  • 2
  • 19
  • 41
9
votes
2 answers

Akka.Net work queues

I have an existing distributed computing framework built on top of MassTransit and RabbitMQ. There is essentially a manager which responds with work based on requests. Each worker will take a certain amount of items based on the physcial machine…
Telavian
  • 3,752
  • 6
  • 36
  • 60