Skip to content

Instantly share code, notes, and snippets.

@viktors-telle
Last active June 13, 2020 14:03
Show Gist options
  • Save viktors-telle/b90c74bbc21f243709779f3715fdf14d to your computer and use it in GitHub Desktop.
Save viktors-telle/b90c74bbc21f243709779f3715fdf14d to your computer and use it in GitHub Desktop.
using MassTransit;
using MessageOutbox.Outbox;
using Microsoft.Extensions.Logging;
using System.Threading.Tasks;
namespace MessageOutbox.Consumer
{
public class MessageConsumer : IConsumer<IMessage>
{
private readonly ILogger<MessageConsumer> logger;
public MessageConsumer(ILogger<MessageConsumer> logger)
{
this.logger = logger;
}
public Task Consume(ConsumeContext<IMessage> context)
{
logger.LogInformation($"Message with ID \"{context.Message.Id}\" consumed.");
return Task.CompletedTask;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment