I am using the outbox pattern in MassTransit with Entity Framework and RabbitMq in my application.
I found that if I just publish the message to the bus using IPublishEndpoint
it will not be published until I do DbContext.SaveChangesAsync()
.
I understand that this is by design, but I don't need (want) to use outbox for every messages. I.e. I have some messages that are not important to be sent through the outbox, and for that I don't want to require the injection of DbContext
just so I can send the message.
In short, I only want to use the outbox when there is a database involved in a process, i.e. update an entity and send the message (here the database is involved in a process/transaction and here I want the outbox, but when I only need to notify other services of something or just to forward a message, I don't want to use the outbox for that).
Is this possible?
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745273262a4619880.html
评论列表(0条)