为什么发布时RabbitMQ超时(已使用交换联盟)?

时间:2019-01-08 05:37:56

标签: rabbitmq rabbitmq-federation

有关背景信息,我们是一家零售公司,拥有200多家商店。我们将Rabbitmq联合用于200多个RabbitMQ服务器(每个商店中有一个服务器)。每个RabbitMQ服务器都有4个交换机。因此,总共大约有800个交易所。

有一台中央服务器,消息被发布到该中央服务器。这用作其他200台服务器的上游服务器。进行产品更改时,会将消息发送到中央服务器,该消息将转发到其他Rabbitmq服务器,并在每个商店中进行本地处理。我们的应用程序在Windows服务器上的.NET框架上运行(使用Masstransit处理RabbitMQ)。

有时,将事件发布到rabbitMQ时会出现超时错误。这是一个示例:

Properties  
message_id: f68a0000-15f3-0670-085b-08d66b92a0b1
delivery_mode:  2
headers:    
x-correlation-id:   18799970-fea8-431e-8608-d02496194a0a
Content-Type:   application/vnd.masstransit+json
publishId:  1
MT-Reason:  fault
MT-Fault-Message:   Publishing message of type MyCompany.Event.Message timed out after 5000 milliseconds.
MT-Fault-Timestamp: 2018-12-27T00:32:33.6076503Z
MT-Fault-StackTrace:    at MyCompany.ProductCommand.Listener.UpsertProductCommandListener.<PublishMessage>d__10`1.MoveNext() 
at MyCompany.ProductCommand.Listener.UpsertProductCommandListener.<PublishUpdatedEvents>d__8.MoveNext() 
at MyCompany.ProductCommand.Listener.UpsertProductCommandListener.<Consume>d__7.MoveNext() 
at MassTransit.AutofacIntegration.AutofacConsumerFactory`1.<Send>d__3`1.MoveNext() 
at MassTransit.Pipeline.Filters.ConsumerMessageFilter`2.<GreenPipes-IFilter<MassTransit-ConsumeContext<TMessage>>-Send>d__4.MoveNext() 
at MassTransit.Pipeline.Filters.ConsumerMessageFilter`2.<GreenPipes-IFilter<MassTransit-ConsumeContext<TMessage>>-Send>d__4.MoveNext() 
at GreenPipes.Filters.TeeFilter`1.<Send>d__5.MoveNext() 
at GreenPipes.Filters.OutputPipeFilter`2.<GreenPipes-IFilter<TInput>-Send>d__6.MoveNext() 
at GreenPipes.Filters.OutputPipeFilter`2.<GreenPipes-IFilter<TInput>-Send>d__6.MoveNext() 
at MassTransit.Pipeline.Filters.DeserializeFilter.<Send>d__4.MoveNext() 
at GreenPipes.Filters.RescueFilter`2.<GreenPipes-IFilter<TContext>-Send>d__5.MoveNext()
MT-Host-MachineName:    WIN-123456
MT-Host-ProcessName:    MyCompany.ProductCommandListener.WindowsService
MT-Host-ProcessId:  848
MT-Host-Assembly:   MyCompany.ProductCommandListener.WindowsService
MT-Host-AssemblyVersion:    1.0.0.0
MT-Host-MassTransitVersion: 3.5.4.992
MT-Host-FrameworkVersion:   4.0.30319.42000
MT-Host-OperatingSystemVersion: Microsoft Windows NT 6.2.9200.0
content_type:   application/vnd.masstransit+json

每条消息大约5000字节。我们想了解消息是如何超时的。我们在RabbitMQ网站上发现了与ack行为有关的内容:

For routable messages, the basic.ack is sent when a message has been accepted by all the queues. For persistent messages routed to durable queues, this means persisting to disk. For mirrored queues, this means that all mirrors have accepted the message. https://www.rabbitmq.com/confirms.html#when-publishes-are-confirmed

但是,我们找不到有关在联盟中发布确认行为的任何信息。所以我们的问题是

  1. 在交换联合会中,当所有下游服务器都收到消息或上游服务器将消息持久保存到磁盘时,代理发送发布确认?
  2. 如何解决超时错误?

任何帮助将不胜感激。

0 个答案:

没有答案