/// <summary> /// Configure MassTransit to use Azure Service Bus for the transport. /// </summary> /// <param name="configurator">The registration configurator (configured via AddMassTransit)</param> /// <param name="configure">The configuration callback for the bus factory</param> public static void UsingAzureServiceBus(this IBusRegistrationConfigurator configurator, Action <IBusRegistrationContext, IServiceBusBusFactoryConfigurator> configure = null) { configurator.SetBusFactory(new ServiceBusRegistrationBusFactory(configure)); configurator.Registrar.RegisterSingleInstance(provider => { var subscriptionEndpointConnector = provider.GetRequiredService <IBusInstance>() as ISubscriptionEndpointConnector; return(subscriptionEndpointConnector ?? throw new ConfigurationException("The default bus instance is not an Azure Service Bus Instance")); }); }
/// <summary> /// Configure MassTransit to use Azure Service Bus for the transport. /// </summary> /// <param name="configurator">The registration configurator (configured via AddMassTransit)</param> /// <param name="configure">The configuration callback for the bus factory</param> public static void UsingAzureServiceBus(this IBusRegistrationConfigurator configurator, Action <IBusRegistrationContext, IServiceBusBusFactoryConfigurator> configure = null) { configurator.SetBusFactory(new ServiceBusRegistrationBusFactory(configure)); }
/// <summary> /// Configure MassTransit to use the gRPC transport /// </summary> /// <param name="configurator">The registration configurator (configured via AddMassTransit)</param> /// <param name="baseAddress">The base Address of the transport</param> /// <param name="configure">The configuration callback for the bus factory</param> public static void UsingGrpc(this IBusRegistrationConfigurator configurator, Uri baseAddress, Action <IBusRegistrationContext, IGrpcBusFactoryConfigurator> configure = null) { configurator.SetBusFactory(new GrpcRegistrationBusFactory(baseAddress, configure)); }
/// <summary> /// Configure MassTransit to use Amazon SQS for the transport. /// </summary> /// <param name="configurator">The registration configurator (configured via AddMassTransit)</param> /// <param name="configure">The configuration callback for the bus factory</param> public static void UsingAmazonSqs(this IBusRegistrationConfigurator configurator, Action <IBusRegistrationContext, IAmazonSqsBusFactoryConfigurator> configure = null) { configurator.SetBusFactory(new AmazonSqsRegistrationBusFactory(configure)); }
/// <summary> /// Configure MassTransit to use ActiveMQ for the transport. /// </summary> /// <param name="configurator">The registration configurator (configured via AddMassTransit)</param> /// <param name="configure">The configuration callback for the bus factory</param> public static void UsingActiveMq(this IBusRegistrationConfigurator configurator, Action <IBusRegistrationContext, IActiveMqBusFactoryConfigurator> configure = null) { configurator.SetBusFactory(new ActiveMqRegistrationBusFactory(configure)); }