public void Configure(AzureServiceBusQueueConfig configSection, TransportConfig transportConfig)
        {
            var config = NServiceBus.Configure.Instance;

            ConfigureCreationInfrastructure(config, configSection, transportConfig);

            ConfigureReceiveInfrastructure(config, configSection);

            if (!config.Configurer.HasComponent<ISendMessages>())
            {
                ConfigureSendInfrastructure(config, configSection);
            }

            if (!config.Configurer.HasComponent<IPublishMessages>() &&
                !config.Configurer.HasComponent<IManageSubscriptions>())
            {
                ConfigurePublishingInfrastructure(config, configSection);
            }
        }
        private void ConfigureCreationInfrastructure(Configure config, AzureServiceBusQueueConfig configSection, TransportConfig transportConfig)
        {
            config.Configurer.ConfigureComponent<CreatesMessagingFactories>(DependencyLifecycle.InstancePerCall);
            config.Configurer.ConfigureComponent<CreatesNamespaceManagers>(DependencyLifecycle.InstancePerCall);

            config.Configurer.ConfigureComponent<AzureServicebusQueueClientCreator>(DependencyLifecycle.InstancePerCall);
            config.Configurer.ConfigureProperty<AzureServicebusQueueClientCreator>(t => t.MaxRetries, transportConfig.MaxRetries);

            config.Configurer.ConfigureComponent<AzureServiceBusQueueCreator>(DependencyLifecycle.InstancePerCall);
            config.Configurer.ConfigureProperty<AzureServiceBusQueueCreator>(t => t.LockDuration, TimeSpan.FromMilliseconds(configSection.LockDuration));
            config.Configurer.ConfigureProperty<AzureServiceBusQueueCreator>(t => t.MaxSizeInMegabytes, configSection.MaxSizeInMegabytes);
            config.Configurer.ConfigureProperty<AzureServiceBusQueueCreator>(t => t.RequiresDuplicateDetection, configSection.RequiresDuplicateDetection);
            config.Configurer.ConfigureProperty<AzureServiceBusQueueCreator>(t => t.RequiresSession, configSection.RequiresSession);
            config.Configurer.ConfigureProperty<AzureServiceBusQueueCreator>(t => t.DefaultMessageTimeToLive, TimeSpan.FromMilliseconds(configSection.DefaultMessageTimeToLive));
            config.Configurer.ConfigureProperty<AzureServiceBusQueueCreator>(t => t.EnableDeadLetteringOnMessageExpiration, configSection.EnableDeadLetteringOnMessageExpiration);
            config.Configurer.ConfigureProperty<AzureServiceBusQueueCreator>(t => t.DuplicateDetectionHistoryTimeWindow, TimeSpan.FromMilliseconds(configSection.DuplicateDetectionHistoryTimeWindow));
            config.Configurer.ConfigureProperty<AzureServiceBusQueueCreator>(t => t.MaxDeliveryCount, configSection.MaxDeliveryCount);
            config.Configurer.ConfigureProperty<AzureServiceBusQueueCreator>(t => t.EnableBatchedOperations, configSection.EnableBatchedOperations);
            config.Configurer.ConfigureProperty<AzureServiceBusQueueCreator>(t => t.EnablePartitioning, configSection.EnablePartitioning);

            config.Configurer.ConfigureComponent<AzureServicebusTopicClientCreator>(DependencyLifecycle.InstancePerCall);
            config.Configurer.ConfigureComponent<AzureServicebusTopicCreator>(DependencyLifecycle.InstancePerCall);
            config.Configurer.ConfigureProperty<AzureServicebusTopicCreator>(t => t.EnablePartitioning, configSection.EnablePartitioning);

            config.Configurer.ConfigureComponent<AzureServicebusSubscriptionClientCreator>(DependencyLifecycle.InstancePerCall);
            config.Configurer.ConfigureProperty<AzureServicebusSubscriptionClientCreator>(t => t.MaxRetries, transportConfig.MaxRetries);

            config.Configurer.ConfigureComponent<AzureServicebusSubscriptionCreator>(DependencyLifecycle.InstancePerCall);
            config.Configurer.ConfigureProperty<AzureServicebusSubscriptionCreator>(t => t.LockDuration, TimeSpan.FromMilliseconds(configSection.LockDuration));
            config.Configurer.ConfigureProperty<AzureServicebusSubscriptionCreator>(t => t.RequiresSession, configSection.RequiresSession);
            config.Configurer.ConfigureProperty<AzureServicebusSubscriptionCreator>(t => t.DefaultMessageTimeToLive, TimeSpan.FromMilliseconds(configSection.DefaultMessageTimeToLive));
            config.Configurer.ConfigureProperty<AzureServicebusSubscriptionCreator>(t => t.EnableDeadLetteringOnMessageExpiration, configSection.EnableDeadLetteringOnMessageExpiration);
            config.Configurer.ConfigureProperty<AzureServicebusSubscriptionCreator>(t => t.EnableDeadLetteringOnFilterEvaluationExceptions, configSection.EnableDeadLetteringOnFilterEvaluationExceptions);
            config.Configurer.ConfigureProperty<AzureServicebusSubscriptionCreator>(t => t.MaxDeliveryCount, configSection.MaxDeliveryCount);
            config.Configurer.ConfigureProperty<AzureServicebusSubscriptionCreator>(t => t.EnableBatchedOperations, configSection.EnableBatchedOperations);
        }
Example #3
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TransportConfig obj)
 {
     return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
 }
Example #4
0
 public int transportCreate(pjsip_transport_type_e type, TransportConfig cfg)
 {
     int ret = pjsua2PINVOKE.Endpoint_transportCreate(swigCPtr, (int)type, TransportConfig.getCPtr(cfg));
     if (pjsua2PINVOKE.SWIGPendingException.Pending) throw pjsua2PINVOKE.SWIGPendingException.Retrieve();
     return ret;
 }