public CloudQueueSendOnlyBus(ICloudQueueSendOnlyBusConfiguration configuration, SendContextSender sender) { if (configuration == null) throw new ArgumentNullException("configuration"); if (sender == null) throw new ArgumentNullException("sender"); _configuration = configuration; _sender = sender; }
public static CloudQueueSendOnlyBus NewSendOnlyBus(Action<ICloudQueueSendOnlyBusConfigurationBuilder> configure) { if (configure == null) throw new ArgumentNullException("configure"); var builder = new CloudQueueSendOnlyBusConfigurationBuilder(); configure(builder); var configuration = builder.Build(); var queuePool = new CloudQueuePool( configuration.StorageAccount.CreateCloudQueueClient()); var blobContainerPool = new CloudBlobContainerPool( configuration.StorageAccount.CreateCloudBlobClient()); var sender = new SendContextSender( new CloudQueueMessageEnvelopeSender( new CloudQueueSender(queuePool, configuration.SenderConfiguration), new CloudQueueMessageEnvelopeJsonWriter(), new CloudBlobMessageEnvelopeWriter(blobContainerPool, configuration.OverflowBlobContainerName)), new MessageTypeResolver(), configuration.Serializer); return new CloudQueueSendOnlyBus(configuration, sender); }