Skip to content

Commit

Permalink
Plumbed Channel Creation Mode into the Factories BrighterCommand#1444
Browse files Browse the repository at this point in the history
  • Loading branch information
preardon committed Mar 27, 2021
1 parent 965491b commit f049d11
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ 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);
}
}
}
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 f049d11

Please sign in to comment.