Could concurrency limit be on the message type level

25 views
Skip to first unread message

dennis bing leng

unread,
Mar 30, 2017, 11:30:46 PM3/30/17
to masstransit-discuss
HI 

Could concurrency limit be on the message type level?

Here is my config for starting a bus

//group consumers by queue name. 
 var groupedConsumersByQueue = from c in consumers
                group c by ((IQueueName)c).Name
                into g select new {Name = g.Key, Consumers = g.ToList()};

 var busControl = Bus.Factory.CreateUsingRabbitMq(sbc =>
                          {
                                                                        
                                                                         var host = sbc.Host(connectionInfo.HostAddress, h =>
                                                                         {
                                                                             h.Username(connectionInfo.Username);
                                                                             h.Password(connectionInfo.Password);
                                                                         });

                                                                         foreach(var queue in groupedConsumersByQueue) {
                                                                             sbc.ReceiveEndpoint(host,queue.Name, e =>
                                                                                                                  {
                                                                                                                      foreach(var consumer in queue.Consumers ) {
                                                                                                                          
                                                                                                                          e.Consumer(consumer.GetType(), x => consumer);
                                                                                                                         
                                                                                                                         //how I could set the ConcurrencyLimit for each consumer/message type.
                                                                                                                      }
                                                                                                                  });
                                                                         }

                                                                     });


                    busControl.Start();

As you could see that each consumer/message type could have a different concurrency limit, how could I achieve that except that I have to create queue for each consumer/message type. 



Thank you

Bing 

Bing 
Reply all
Reply to author
Forward
0 new messages