masstransit

Why a simple configuration in MassTransit creates 2 queues and 3 exchanges?

折月煮酒 提交于 2019-12-23 03:11:44
问题 I created a MassTransit quickstart program to interact with my localhost RabbitMQ: namespace ConsoleApp1 { public static class Program { public class YourMessage { public string Text { get; set; } } public static async Task Main(params string[] args) { var bus = Bus.Factory.CreateUsingRabbitMq(sbc => { var host = sbc.Host(new Uri("rabbitmq://localhost"), h => { h.Username("guest"); h.Password("guest"); }); sbc.ReceiveEndpoint(host, "test_queue", ep => { ep.Handler<YourMessage>(async context =

MassTransit 3.2.1 - Validation

我的梦境 提交于 2019-12-23 02:19:14
问题 I want to validate an incoming message, using FluentValidation in my case, and if it fails it should return immediately. I looked into http://docs.masstransit-project.com/en/latest/usage/observers.html, and in my case, I like the idea of public class ConsumeObserver : IConsumeObserver { Task IConsumeObserver.PreConsume<T>(ConsumeContext<T> context) { //1.Validate here //2. If success go on to consumer //3. If fails exit with the result of validation and don't go through consumer. } Task

Mass Transit : No consumer

一笑奈何 提交于 2019-12-22 11:33:30
问题 Have a newbie question about Mass Transit ESB I am trying MassTransit for the first time and trying to get my head around how the queues are created and how messages are consumed. I have a web application and a Console application trying to do publish / consume respectively This is my initialization code. var bus = Bus.Factory.CreateUsingRabbitMq(sbc => { var host = sbc.Host(new Uri(hostName), h => { h.Username(userName); h.Password(password); }); }); Then from the web app i call the

MassTransit MSMQ Pub with multi-sub. When is RuntimeServices ready?

醉酒当歌 提交于 2019-12-22 10:45:41
问题 I've set up a simple test comprising a publisher with two subscribers, all running on a single machine using MSMQ and MassTransit (2.1.1) RuntimeServices which is using a local Sql Server database. I've included the Bus set up code below so you can see what's set up. I'm starting each component manually and independently to try to workout what happens if a subscriber ins't running. I ran the two subscribers first so the queues and subscriptions are all set up and then quit them both, without

Handling transition to state for multiple events

为君一笑 提交于 2019-12-22 07:36:11
问题 I have a MassTransitStateMachine that orchestrates a process which involves creating multiple events. Once all of the events are done, I want the state to transition to a 'clean up' phase. Here is the relevant state declaration and filter function: During(ImportingData, When(DataImported) // When we get a data imported event, mark this source as done. .Then(MarkImportCompletedForLocation), When(DataImported, IsAllDataImported) // Once all are done, we can transition to cleaning up... .Then

How to log failed message in masstransit?

旧街凉风 提交于 2019-12-22 05:14:23
问题 I'm looking for a good solution to log failed message, right after retry limit is exceeded, without having a deal with error queue. What I've found so far: I can inherit from InMemoryInboundMessageTracker and override IsRetryLimitExceeded , but at this point there no information about message itself except id. I can implement IInboundMessageInterceptor and get IConsumeContext in Pre/PostDispatch , but at this point there no information about success/fail. So as a solution, I can get

How to peek at message while dependencies are being built?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-21 22:41:53
问题 I building multitenancy into the unit of work for a set of services. I want to keep the tenancy question out of the way of day-to-day business domain work, and I do not want to touch every existing consumer in the system (I am retrofitting the multitenancy onto a system without any prior concept of a tenant). Most messages in the system will be contexted by a tenant. However, there will be some infrastructure messages which will not be, particularly for the purpose of automating tenant

Multiple consumers for the same message through Unity not working in MassTransit

风流意气都作罢 提交于 2019-12-19 03:09:23
问题 I'm having a lot of problems lately because of what seems to be a bug in the MassTransit.UnityIntegration package, primarily due to the fact that registration names are not being considered. For instance, if I register my classes like this: var container = new UnityContainer() .RegisterType<Consumes<Command1>.All, Handler1>("Handler1") .RegisterType<Consumes<Command1>.All, Handler3>("Handler3"); A few lines later, I use the LoadFrom extension method to get the registered consumers in the

nServiceBus, Rhino Service Bus, MassTransit - Videos, Demos, Learning Resources

空扰寡人 提交于 2019-12-18 10:16:52
问题 Hey people would love to hear about any resources you have or know about for nServiceBus, Rhino Service Bus and MassTransit. Videos? Blog posts? Books? Demo Projects etc 回答1: The discussion group at Google Groups is a very good resource. So far I have written three articles about nServiceBus at ArtOfBabel.com: Open Source Integration with nServiceBus Up and Running with nServiceBus 1.9 nServiceBus: Building the Solution A few more articles should be available soon too. 回答2: If you are

Masstransit queues prefixed with bus and postfixed with random string

匆匆过客 提交于 2019-12-17 21:15:55
问题 I am taking over a project where Masstransit is being used as abstraction over RabbitMQ. I see a lot of queues prefixed with "bus" and postfixed with some random character string. What are theses queues being used for and how are they created? Any hint will be most welcome. 回答1: That's temporary queues. more info in documentation And this class of MassTransit generates it (see CreateTemporaryQueueName method invoking) 来源: https://stackoverflow.com/questions/49026670/masstransit-queues