Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plumb in BatchSize into ASB producer registry factory #1992

Merged
merged 2 commits into from
Feb 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ public AzureServiceBusProducerRegistryFactory(
/// Creates message producers.
/// </summary>
/// <returns>A has of middleware clients by topic, for sending messages to the middleware</returns>
public IAmAProducerRegistry Create()
public IAmAProducerRegistry Create(int bulkSendBatchSize = 10)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please move this to the Constructor and plumb it in as a private readonly variable

{
var producers = new Dictionary<string, IAmAMessageProducer>();
foreach (var publication in _asbPublications)
{
producers[publication.Topic] = AzureServiceBusMessageProducerFactory.Get(_clientProvider, publication);;
producers[publication.Topic] = AzureServiceBusMessageProducerFactory.Get(_clientProvider, publication, bulkSendBatchSize);
}

return new ProducerRegistry(producers);
Expand Down
4 changes: 2 additions & 2 deletions src/Paramore.Brighter/IAmAProducerRegistryFactory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#region Licence
#region Licence
/* The MIT License (MIT)
Copyright © 2015 Toby Henderson <[email protected]>

Expand Down Expand Up @@ -35,7 +35,7 @@ public interface IAmAProducerRegistryFactory
/// Creates message producers.
/// </summary>
/// <returns>A has of middleware clients by topic, for sending messages to the middleware</returns>
IAmAProducerRegistry Create();
IAmAProducerRegistry Create(int bulkSendBatchSize = 10);

}
}