当前位置: 首页>>代码示例>>C#>>正文


C# JobHostConfiguration.UseServiceBus方法代码示例

本文整理汇总了C#中JobHostConfiguration.UseServiceBus方法的典型用法代码示例。如果您正苦于以下问题:C# JobHostConfiguration.UseServiceBus方法的具体用法?C# JobHostConfiguration.UseServiceBus怎么用?C# JobHostConfiguration.UseServiceBus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JobHostConfiguration的用法示例。


在下文中一共展示了JobHostConfiguration.UseServiceBus方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ServiceBusArgumentsDisplayTestsFixture

        public ServiceBusArgumentsDisplayTestsFixture()
            : base(cleanStorageAccount: true)
        {
            _hostConfiguration = new JobHostConfiguration(StorageAccount.ConnectionString)
            {
                TypeLocator = new ExplicitTypeLocator(
                    typeof(ServiceBusArgumentsDisplayFunctions),
                    typeof(DoneNotificationFunction))
            };

            #if VNEXT_SDK
            ServiceBusConfiguration serviceBusConfig = new ServiceBusConfiguration();
            serviceBusConfig.ConnectionString = ServiceBusAccount;
            _serviceBusConnectionString = serviceBusConfig.ConnectionString;
            _hostConfiguration.UseServiceBus(serviceBusConfig);
            #else
            _serviceBusConnectionString = ServiceBusAccount;
            _hostConfiguration.ServiceBusConnectionString = _serviceBusConnectionString;
            #endif

            _namespaceManager = NamespaceManager.CreateFromConnectionString(_serviceBusConnectionString);

            // ensure we're starting in a clean state
            CleanServiceBusQueues();

            // now run the entire end to end scenario, causing all the job functions
            // to be invoked
            RunEndToEnd();
        }
开发者ID:farukc,项目名称:azure-webjobs-sdk-dashboard-tests,代码行数:29,代码来源:ServiceBusArgumentsDisplayFixture.cs

示例2: Main

		static void Main()
		{
			_servicesBusConnectionString = AmbientConnectionStringProvider.Instance.GetConnectionString(ConnectionStringNames.ServiceBus);
			namespaceManager = NamespaceManager.CreateFromConnectionString(_servicesBusConnectionString);

			if (!namespaceManager.QueueExists(nameof(Step1)))
			{
				namespaceManager.CreateQueue(nameof(Step1));
			}
			if (!namespaceManager.QueueExists(nameof(Step2)))
			{
				namespaceManager.CreateQueue(nameof(Step2));
			}

			JobHostConfiguration config = new JobHostConfiguration();
			config.UseServiceBus();



			var host = new JobHost(config);

			CreateStartMessage();

			host.RunAndBlock();
		}
开发者ID:Cognim,项目名称:Azure-webjobs-and-service-bus-tryout,代码行数:25,代码来源:Program.cs

示例3: Main

 // Please set the following connection strings in app.config for this WebJob to run:
 // AzureWebJobsDashboard and AzureWebJobsStorage
 static void Main()
 {
     JobHostConfiguration config = new JobHostConfiguration();
       config.UseServiceBus();
       JobHost host = new JobHost(config);
       host.RunAndBlock();
 }
开发者ID:michael-chi,项目名称:Azure-IOTHub,代码行数:9,代码来源:Program.cs

示例4: UseServiceBus_NoServiceBusConfiguration_PerformsExpectedRegistration

        public void UseServiceBus_NoServiceBusConfiguration_PerformsExpectedRegistration()
        {
            JobHostConfiguration config = new JobHostConfiguration();
            string serviceBusConnection = "test service bus connection";
#pragma warning disable 0618
            config.ServiceBusConnectionString = serviceBusConnection;
#pragma warning restore 0618

            IExtensionRegistry extensions = config.GetService<IExtensionRegistry>();
            IExtensionConfigProvider[] configProviders = extensions.GetExtensions<IExtensionConfigProvider>().ToArray();
            Assert.Equal(0, configProviders.Length);

            config.UseServiceBus();

            // verify that the service bus config provider was registered
            configProviders = extensions.GetExtensions<IExtensionConfigProvider>().ToArray();
            Assert.Equal(1, configProviders.Length);

            ServiceBusExtensionConfig serviceBusExtensionConfig = (ServiceBusExtensionConfig)configProviders.Single();

            // verify that a default ServiceBusConfiguration was created, with the host (obsolete)
            // service bus connection string propagated
#pragma warning disable 0618
            Assert.Equal(serviceBusConnection, serviceBusExtensionConfig.Config.ConnectionString);
#pragma warning restore 0618
        }
开发者ID:rafaelmtz,项目名称:azure-webjobs-sdk,代码行数:26,代码来源:ServiceBusJobHostConfigurationExtensionsTests.cs

示例5: UseServiceBus_ThrowsArgumentNull_WhenServiceBusConfigIsNull

 public void UseServiceBus_ThrowsArgumentNull_WhenServiceBusConfigIsNull()
 {
     JobHostConfiguration config = new JobHostConfiguration();
     ArgumentNullException exception = Assert.Throws<ArgumentNullException>(() =>
         {
             config.UseServiceBus(null);
         });
     Assert.Equal("serviceBusConfig", exception.ParamName);
 }
开发者ID:ConnorMcMahon,项目名称:azure-webjobs-sdk,代码行数:9,代码来源:ServiceBusJobHostConfigurationExtensionsTests.cs

示例6: Main

        static void Main(string[] args)
        {
            var config = new JobHostConfiguration();
            var serviceBusConfig = new ServiceBusConfiguration();

            config.UseServiceBus(serviceBusConfig);

            var jobHost = new JobHost(config);
        }
开发者ID:iremmats,项目名称:webjob-demo-testing,代码行数:9,代码来源:Program.cs

示例7: Main

        // Please set the following connection strings in app.config for this WebJob to run:
        // AzureWebJobsDashboard and AzureWebJobsStorage
        static void Main()
        {
            var cs = CloudConfigurationManager.GetSetting("Microsoft.ServiceBus.ConnectionString");
            var config = new JobHostConfiguration();
            config.UseServiceBus();
            var host = new JobHost(config);
            // The following code ensures that the WebJob will be running continuously

            host.RunAndBlock();
        }
开发者ID:ms-iotkithol-jp,项目名称:IoTKitHoLV3,代码行数:12,代码来源:Program.cs

示例8: Main

 public static void Main(string[] args)
 {
     JobHostConfiguration config = new JobHostConfiguration();
     ServiceBusConfiguration servicebusConfig = new ServiceBusConfiguration
     {
         ConnectionString = sbConnectionString
     };
     config.UseServiceBus(servicebusConfig);
     JobHost host = new JobHost(config);
     host.RunAndBlock();
 }
开发者ID:martin-chambers,项目名称:GetCMEWebAPI,代码行数:11,代码来源:Program.cs

示例9: Main

 public static void Main()
 {
     var config = new JobHostConfiguration();
     var serviceBusConfig = new ServiceBusConfiguration()
     {
         ConnectionString = AmbientConnectionStringProvider
             .Instance
             .GetConnectionString(ConnectionStringNames.ServiceBus)
     };
     config.UseServiceBus(serviceBusConfig);
     var host = new JobHost(config);
     host.RunAndBlock();
 }
开发者ID:michaellperry,项目名称:Commuter,代码行数:13,代码来源:Program.cs

示例10: Main

 /// <summary>
 /// Defines the entry point of the application.
 /// </summary>
 private static void Main()
 {
     Register();
     SignalRHandler.Initialize();
     // JobHostConfiguration config = new JobHostConfiguration();
     var config = new JobHostConfiguration
                  {
                      JobActivator = new Activator(Container)
                  };
     config.UseServiceBus();
     var host = new JobHost(config);
     host.RunAndBlock();
 }
开发者ID:uwudamith,项目名称:Welkindev,代码行数:16,代码来源:Program.cs

示例11: Main

        public static void Main()
        {
            _servicesBusConnectionString = AmbientConnectionStringProvider.Instance.GetConnectionString(ConnectionStringNames.ServiceBus);
            _namespaceManager = NamespaceManager.CreateFromConnectionString(_servicesBusConnectionString);

            JobHostConfiguration config = new JobHostConfiguration();
            ServiceBusConfiguration serviceBusConfig = new ServiceBusConfiguration
            {
                ConnectionString = _servicesBusConnectionString
            };
            config.UseServiceBus(serviceBusConfig);

            JobHost host = new JobHost(config);
            host.RunAndBlock();
        }
开发者ID:marcoparenzan,项目名称:SQLSAT462,代码行数:15,代码来源:Program.cs

示例12: Main

        static void Main()
        {
            var config = new JobHostConfiguration
            {
                DashboardConnectionString = Configurations.StorageConnectionString,
                StorageConnectionString = Configurations.StorageConnectionString
            };
            config.UseServiceBus(new ServiceBusConfiguration {
                ConnectionString = Configurations.ServiceBusConnectionString
            });

            using (var host = new JobHost(config))
            {
                host.RunAndBlock();
            }
        }
开发者ID:Enttoi,项目名称:enttoi-jobs,代码行数:16,代码来源:Program.cs

示例13: Main

        public static void Main()
        {
            _servicesBusConnectionString = ConfigurationManager.ConnectionStrings["AzureWebJobsServiceBus"].ConnectionString;
            _namespaceManager = NamespaceManager.CreateFromConnectionString(_servicesBusConnectionString);
            CreateStartMessage();

            JobHostConfiguration config = new JobHostConfiguration();
            ServiceBusConfiguration serviceBusConfig = new ServiceBusConfiguration
            {
                ConnectionString = _servicesBusConnectionString
            };
            config.UseServiceBus(serviceBusConfig);

            JobHost host = new JobHost(config);
            host.RunAndBlock();
        }
开发者ID:harishc27,项目名称:azure-webjobs-sdk-samples,代码行数:16,代码来源:Program.cs

示例14: Main

        public static void Main(string[] args)
        {
            var jobHostConfiguration = new JobHostConfiguration();
            jobHostConfiguration.UseServiceBus(new ServiceBusConfiguration
            {
                ConnectionString = "Endpoint=sb://kviksag.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=ru4LnxhI8qtgHtcRb9U1LROIYl86qJJRudM/cz3tgfw="
            });

            jobHostConfiguration.UseCore();

            jobHostConfiguration.DashboardConnectionString = "DefaultEndpointsProtocol=https;AccountName=kviksag;AccountKey=3qbeYTgN13XDOVA6sqGn7OyZXs2TcHt3Z+TomEs0GU7GCK7VC8A+hUaMvawbkUshhFLKCCDXrpdisOq6nZ1VNQ==;BlobEndpoint=https://kviksag.blob.core.windows.net/;TableEndpoint=https://kviksag.table.core.windows.net/;QueueEndpoint=https://kviksag.queue.core.windows.net/;FileEndpoint=https://kviksag.file.core.windows.net/";
            jobHostConfiguration.StorageConnectionString = "DefaultEndpointsProtocol=https;AccountName=kviksag;AccountKey=3qbeYTgN13XDOVA6sqGn7OyZXs2TcHt3Z+TomEs0GU7GCK7VC8A+hUaMvawbkUshhFLKCCDXrpdisOq6nZ1VNQ==;BlobEndpoint=https://kviksag.blob.core.windows.net/;TableEndpoint=https://kviksag.table.core.windows.net/;QueueEndpoint=https://kviksag.queue.core.windows.net/;FileEndpoint=https://kviksag.file.core.windows.net/";

            var jobHost = new JobHost(jobHostConfiguration);
            jobHost.RunAndBlock();
        }
开发者ID:kristianhald,项目名称:WebJobsPresentation,代码行数:16,代码来源:Program.cs

示例15: Main

        static void Main(string[] args)
        {
            Console.WriteLine("Starting ServiceBus Trigger...");
            Console.WriteLine();

            var connectionString = AmbientConnectionStringProvider.Instance.GetConnectionString(ConnectionStringNames.ServiceBus);

            JobHostConfiguration config = new JobHostConfiguration();
            ServiceBusConfiguration serviceBusConfig = new ServiceBusConfiguration
            {
                ConnectionString = connectionString
            };
            config.UseServiceBus(serviceBusConfig);

            JobHost host = new JobHost(config);
            host.RunAndBlock();
        }
开发者ID:timgabrhel,项目名称:cloudacademy-webapps-demo,代码行数:17,代码来源:Program.cs


注:本文中的JobHostConfiguration.UseServiceBus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。