Files
Musify/Infrastructure/MassTransit/Consumers/RemoveFileConsumer.cs
T
2026-03-25 18:12:08 +01:00

24 lines
699 B
C#

using MassTransit;
using Musify.Application.Events;
using Musify.Infrastructure.MassTransit.RoutingSlip.Builders;
namespace Musify.Infrastructure.MassTransit.Consumers
{
public class RemoveFileConsumer(
IBus bus,
RemoveFileFromBucketRoutingSlipBuilder routingSlipBuilder)
: IConsumer<RemoveFileEvent>
{
public const string QueueName = "remove-file";
public async Task Consume(ConsumeContext<RemoveFileEvent> consumeContext)
{
var routingSlip = routingSlipBuilder
.Build(consumeContext.Message, consumeContext.CorrelationId)
.Build();
await bus.Execute(routingSlip);
}
}
}