public void Configure(IConfiguration configuration, IClientBuilder clientBuilder) { clientBuilder .AddRabbitMqStream(Globals.StreamProviderNameDefault, configurator => { configurator.ConfigureRabbitMq(ob => ob.Configure(options => { options.Connection.Port = ToxiProxyHelpers.ClientPort; options.QueueNamePrefix = Globals.StreamNameSpaceDefault; options.UseQueuePartitioning = false; })); }) .AddRabbitMqStream(Globals.StreamProviderNameProtoBuf, configurator => { configurator.ConfigureQueueDataAdapter(ProtoBufDataAdapter.Create); configurator.ConfigureRabbitMq(ob => ob.Configure(options => { options.Connection.Port = ToxiProxyHelpers.ClientPort; options.QueueNamePrefix = Globals.StreamNameSpaceProtoBuf; options.UseQueuePartitioning = false; })); }) .Configure <ClientMessagingOptions>(options => { options.ResponseTimeout = TimeSpan.FromMinutes(5); }) .ConfigureLogging(log => log.AddTestDebugLogging()); }
public static IClientBuilder ConfigureStreamsAndLogging(this IClientBuilder builder) { return(builder .AddRabbitMqStream(Globals.StreamProviderNameDefault, configurator => { configurator.ConfigureRabbitMq(host: "localhost", port: ToxiProxyHelpers.RmqProxyPort, virtualHost: "/", user: "******", password: "******", queueName: Globals.StreamNameSpaceDefault); }) .AddRabbitMqStream <ProtoBufBatchContainerSerializer>(Globals.StreamProviderNameProtoBuf, configurator => { configurator.ConfigureRabbitMq(host: "localhost", port: ToxiProxyHelpers.RmqProxyPort, virtualHost: "/", user: "******", password: "******", queueName: Globals.StreamNameSpaceProtoBuf); }) .ConfigureLogging(log => log.AddConsole())); }
/// <summary> /// Configure client to use RMQ persistent streams. /// </summary> public static IClientBuilder AddRabbitMqStream(this IClientBuilder builder, string name, Action <OptionsBuilder <RabbitMqOptions> > configureOptions) => builder.AddRabbitMqStream(name, b => b.Configure(configureOptions));