Skip to content

Commit 95d73dc

Browse files
committed
Added support for prefetch count customisation
1 parent c7f6371 commit 95d73dc

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

API/SOFTURE.MessageBroker.Rabbit/DependencyInjection.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public static IServiceCollection AddCommonPublisher<TSettings>(this IServiceColl
4545
public static IServiceCollection AddCommonConsumers<TSettings>(
4646
this IServiceCollection services,
4747
Assembly assembly,
48-
int retryCount = 0)
48+
int retryCount = 0,
49+
int prefetchCount = 50)
4950
where TSettings : IRabbitSettings
5051
{
5152
var consumerTypes = GetConsumers<IMessage>(assembly);
@@ -97,7 +98,7 @@ public static IServiceCollection AddCommonConsumers<TSettings>(
9798
foreach (var type in bulkConsumerTypes)
9899
{
99100
c.ConfigureConsumer(ctx, type);
100-
c.PrefetchCount = 50;
101+
c.PrefetchCount = prefetchCount;
101102

102103
if (retryCount != 0)
103104
c.UseMessageRetry(r => r.Immediate(retryCount));

0 commit comments

Comments
 (0)