/// <summary> /// Configures a ActiveMQ bus by using the specified application configuration. /// </summary> /// <param name="builder"><see cref="IMassTransitBuilder"/></param>. /// <param name="configuration">The <see cref="IConfiguration"/> being bound.</param> /// <param name="hostConfigurator">The configuration callback to configure the ActiveMQ bus.</param> public static void UseActiveMq(this IMassTransitBuilder builder, IConfiguration configuration, Action <IActiveMqHostBuilder> hostConfigurator = null) { if (configuration == null) { throw new ArgumentNullException(nameof(configuration)); } var connectionName = configuration["ConnectionName"]; var hostBuilder = new ActiveMqHostBuilder(builder.Services, connectionName, configuration); hostConfigurator?.Invoke(hostBuilder); }
/// <summary> /// Configures a ActiveMQ bus. /// </summary> /// <param name="builder"><see cref="IMassTransitBuilder"/></param> /// <param name="connectionName">The client-provided connection name.</param> /// <param name="hostAddress">The URI host address of the ActiveMQ host (example: activemq://host:port/).</param> /// <param name="hostConfigurator">The configuration callback to configure the ActiveMQ bus.</param> public static void UseActiveMq(this IMassTransitBuilder builder, string connectionName, Uri hostAddress, Action <IActiveMqHostBuilder> hostConfigurator = null) { if (builder == null) { throw new ArgumentNullException(nameof(builder)); } if (hostAddress == null) { throw new ArgumentNullException(nameof(hostAddress)); } var hostBuilder = new ActiveMqHostBuilder(builder.Services, connectionName, hostAddress); hostConfigurator?.Invoke(hostBuilder); }