protected override void ConfigureServiceBusReceiveEndpoint(IServiceBusReceiveEndpointConfigurator configurator) { base.ConfigureServiceBusReceiveEndpoint(configurator); configurator.EnableDuplicateDetection(TimeSpan.FromSeconds(30)); _receivedA = Handled <FirstInterface>(configurator, context => context.Message.Value == "A"); _receivedB = Handled <FirstInterface>(configurator, context => context.Message.Value == "B"); configurator.Handler <FirstInterface>(async context => Interlocked.Increment(ref _count)); }
protected override void ConfigureInputQueueEndpoint(IServiceBusReceiveEndpointConfigurator configurator) { configurator.PrefetchCount = 64; configurator.Handler <PingMessage>(async context => { try { await context.RespondAsync(new PongMessage(context.Message.CorrelationId)); } catch (Exception ex) { Console.WriteLine(ex); } }); }
protected override void ConfigureInputQueueEndpoint(IServiceBusReceiveEndpointConfigurator configurator) { configurator.PrefetchCount = 64; configurator.Handler<PingMessage>(async context => { try { await context.RespondAsync(new PongMessage(context.Message.CorrelationId)); } catch (Exception ex) { Console.WriteLine(ex); } }); }