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));
        }
예제 #2
0
        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);
                }
            });
        }
예제 #3
0
        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);
                }
            });
        }