Skip to content

Commit

Permalink
Merge pull request #1458 from preardon/bug/1444-PlumInMakeChannel
Browse files Browse the repository at this point in the history
Plumbed Channel Creation Mode into the Factories #1444
  • Loading branch information
iancooper authored Mar 29, 2021
2 parents 965491b + 4a22605 commit 7accc8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ public IAmAMessageConsumer Create(Subscription subscription)

return new AzureServiceBusConsumer(subscription.RoutingKey, subscription.ChannelName,
new AzureServiceBusMessageProducer(nameSpaceManagerWrapper,
new TopicClientProvider(_configuration)), nameSpaceManagerWrapper,
new MessageReceiverProvider(_configuration), receiveMode: _configuration.AckOnRead ? ReceiveMode.PeekLock : ReceiveMode.ReceiveAndDelete);
new TopicClientProvider(_configuration), subscription.MakeChannels), nameSpaceManagerWrapper,
new MessageReceiverProvider(_configuration),
makeChannels: subscription.MakeChannels,
receiveMode: _configuration.AckOnRead ? ReceiveMode.PeekLock : ReceiveMode.ReceiveAndDelete,
batchSize: subscription.BufferSize);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ namespace Paramore.Brighter.MessagingGateway.AzureServiceBus
{
public static class AzureServiceBusMessageProducerFactory
{
public static AzureServiceBusMessageProducer Get(AzureServiceBusConfiguration configuration)
public static AzureServiceBusMessageProducer Get(AzureServiceBusConfiguration configuration, OnMissingChannel makeChannel = OnMissingChannel.Create)
{
var nameSpaceManagerWrapper = new ManagementClientWrapper(configuration);
var topicClientProvider = new TopicClientProvider(configuration);

return new AzureServiceBusMessageProducer(nameSpaceManagerWrapper, topicClientProvider);
return new AzureServiceBusMessageProducer(nameSpaceManagerWrapper, topicClientProvider, makeChannel);
}
}
}

0 comments on commit 7accc8b

Please sign in to comment.