コード例 #1
0
        public Task HandleAsync(HelloNewSchemaIntegrationEvent @event, IHandleContext context, object sender)
        {
            this.logger.LogInformation($"Handling {nameof(HelloNewSchemaIntegrationEvent)}");

            context.Commit();

            return(Task.CompletedTask);
        }
コード例 #2
0
        public async Task HandleAsync(HelloWorldIntegrationEvent @event, IHandleContext context, object sender)
        {
            this.logger.LogInformation($"New integration event received! value: '{@event.Value}'");

            this.logger.LogInformation("----------Message metadata----------");

            this.logger.LogInformation($"Id: {context.MessageContext.Id}");
            this.logger.LogInformation($"SentTime: {context.MessageContext.SentTime}");
            this.logger.LogInformation($"Name: {context.MessageContext.Name}");
            this.logger.LogInformation($"Group: {context.MessageContext.Group}");

            // Any operation
            await Task.Delay(TimeSpan.FromSeconds(1));

            this.logger.LogInformation("Set message as commited...");

            context.Commit(context.MessageContext.Messsage.ConsumerResult);
        }