masstransit

MassTransit capping message rates at 10

拥有回忆 提交于 2019-12-09 19:25:48
问题 I have a mass transit consumer service set up to work with RabbitMQ and I can't figure out how to increase the speed of the consumer - it seems to hard cap at 10 messages received per second. I have tried the steps listed here: https://groups.google.com/forum/#!msg/masstransit-discuss/plP4n2sixrY/xfORgTPqcwsJ, with no success - setting the prefetch and the concurrent consumers to 25 does nothing other than increasing the acknowledged messages, but it doesn't increase the rate at which the

如何优雅的使用RabbitMQ

泄露秘密 提交于 2019-12-09 12:25:26
目录 RabbitMQ无疑是目前最流行的消息队列之一,对各种语言环境的支持也很丰富,作为一个.NET developer有必要学习和了解这一工具。消息队列的使用场景大概有3种: 1、系统集成,分布式系统的设计。各种子系统通过消息来对接,这种解决方案也逐步发展成一种架构风格,即“通过消息传递的架构”。 2、当系统中的同步处理方式严重影响了吞吐量,比如日志记录。假如需要记录系统中所有的用户行为日志,如果通过同步的方式记录日志势必会影响系统的响应速度,当我们将日志消息发送到消息队列,记录日志的子系统就会通过异步的方式去消费日志消息。 3、系统的高可用性,比如电商的秒杀场景。当某一时刻应用服务器或数据库服务器收到大量请求,将会出现系统宕机。如果能够将请求转发到消息队列,再由服务器去消费这些消息将会使得请求变得平稳,提高系统的可用性。 如果想学习Java工程化、高性能及分布式、深入浅出。微服务、Spring,MyBatis,Netty源码分析的朋友可以加我的Java高级交流:854630135,群里有阿里大牛直播讲解技术,以及Java大型互联网技术的视频免费分享给大家。 一、开始使用RabbitMQ RabbitMQ官网提供了详细的安装步骤,另外官网还提供了RabbitMQ在六种场景的使用教程。其中教程1、3、6将覆盖99%的使用场景,所以正常来说只需要搞清楚这3个教程即可快速上手。 二

Pros/Cons of using BizTalk instead of NServiceBus or MassTransit

风流意气都作罢 提交于 2019-12-09 09:23:44
问题 I am curious if it even makes consider BizTalk for the implementation of a pub/sub messaging architecture (basically what you can do with NServiceBus or MassTransit is all I really need). My manager tends to want to stick with frameworks provided directly from Microsoft and so as part of my due diligence as to which one to use I need to give a good set of pro/cons for both sides. Any guidance would be greatly appreciated! 回答1: One of the major cons of a Broker is that it is very difficult to

How to implement a competing consumer solution?

假如想象 提交于 2019-12-09 08:56:00
问题 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 in MassTransit or NServiceBus failed to many layers of indirection. Any help will be greatly appreciated. 回答1: With MassTransit and MSMQ you can achieve this using the Distributor component. Note that if you use MassTransit with RabbitMQ instead of

ASP.NET Core service not creating RabbitMQ queue

一曲冷凌霜 提交于 2019-12-08 21:48:01
问题 Being a new user of MassTransit and RabbitMQ I'm currently trying to make my ASP.NET core service to work with MassTransit. Taking this documentation section to configure MassTransit and ASP.NET Core I'm unable to get it working. Currently (part of) the Startup.cs looks like services.AddMassTransit(x => { x.AddConsumer<MailConsumer>(); x.AddConsumer<MailFailedConsumer>(); x.AddBus(provider => ConfigureBus(provider, rabbitMqConfigurations)); }); private IBusControl ConfigureBus(

Can´t add header to MassTransit message from OperationContext?

∥☆過路亽.° 提交于 2019-12-08 10:00:32
问题 I am trying to add a header to a Masstransit message containing information from the currently logged user on a WCF Web application. So at my web app, I have the following when the app starts: IBusControl bus = Bus.Factory.CreateUsingRabbitMq(cfg => { cfg.Host(new Uri("rabbitmq://localhost/test"), r => { //... }); cfg.ConfigureSend( s => s.UseSendExecute( c => c.Headers.Set(Constants.UserInfo, OperationContext.Current.Channel.Extensions.Find<PropertyUserInfo>().Info))); }); I am using an IoC

RabbitMQ generates _skipped queues which I want to ignore

北城以北 提交于 2019-12-08 08:26:21
问题 Can anyone guess what the problem can be because I'm clueless on how to solve this. RabbitMQ generates _skipped queues and I don't have a clue why it is generating those. It is being generated when doing a publish request response. Request Client is created using following method in MassTransit.RequestClientExtensions public static IRequestClient<TRequest, TResponse> CreatePublishRequestClient<TRequest, TResponse>(this IBus bus, TimeSpan timeout, TimeSpan? ttl = null, Action<SendContext

Understanding “Finalize” in MassTransit

十年热恋 提交于 2019-12-08 06:20:22
问题 I'm having some trouble understanding how Finalize() works in MassTransit, and specifically whether it can be executed during the initial state. Setup: public Event<ICrawlRequestCreated> CrawlCreated { get; private set; } public Event CrawlFailed { get; private set; } public State Executing { get; private set; } public State Completed { get; private set; } public State Failed { get; private set; } public WorkflowSaga() { InstanceState(x => x.CurrentState); Initially( When(CrawlCreated) .Then

Derived types are not published to consumers in MassTransit

雨燕双飞 提交于 2019-12-08 01:20:44
问题 I am having issues publishing generic messages for derived types and having the handler invoked using MassTransit v2.8.0. If I publish a message of type HtmlBlockNewMessage , the consumer is never invoked. If I publish a ServiceBusMessage object and change the consumer to Consumes<ServiceBusMessage>.Context , the consumer is invoked. The code fails for a derived type. It only works for the parent type (ServiceBusMessage). Types: [Serializable] public class ServiceBusMessage { } [Serializable]

Derived types are not published to consumers in MassTransit

☆樱花仙子☆ 提交于 2019-12-06 14:32:31
I am having issues publishing generic messages for derived types and having the handler invoked using MassTransit v2.8.0. If I publish a message of type HtmlBlockNewMessage , the consumer is never invoked. If I publish a ServiceBusMessage object and change the consumer to Consumes<ServiceBusMessage>.Context , the consumer is invoked. The code fails for a derived type. It only works for the parent type (ServiceBusMessage). Types: [Serializable] public class ServiceBusMessage { } [Serializable] public class ServiceBusResponse { public int ResultCode { get; set; } } // Request [Serializable]