Created
April 22, 2022 12:19
-
-
Save alikrc/8a94d7ae8a241c16a0a1ea1ff76726ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using MassTransit; | |
using MasstransitDemo.Shared; | |
using System.Text.Json; | |
namespace MasstransitDemo.Consumer; | |
public class NotificationCreatedConsumer : IConsumer<INotificationCreated> | |
{ | |
public async Task Consume(ConsumeContext<INotificationCreated> context) | |
{ | |
var serializedMessage = JsonSerializer.Serialize(context.Message, new JsonSerializerOptions { }); | |
Console.WriteLine($"NotificationCreated event consumed. Message: {serializedMessage}"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment