You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
abp/samples/RabbitMqEventBus/App2/App2TextEventHandler.cs

35 lines
1.1 KiB

using System;
using System.Threading.Tasks;
using SharedModule;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed;
namespace App2
{
public class App2TextEventHandler : IDistributedEventHandler<TextEventData>, ITransientDependency
{
private readonly IDistributedEventBus _distributedEventBus;
public App2TextEventHandler(IDistributedEventBus distributedEventBus)
{
_distributedEventBus = distributedEventBus;
}
public Task HandleEventAsync(TextEventData eventData)
{
Console.WriteLine("************************ INCOMING MESSAGE ****************************");
Console.WriteLine(eventData.TextMessage);
Console.WriteLine("**********************************************************************");
_distributedEventBus.PublishAsync(
new TextReceivedEventData
{
ReceivedText = eventData.TextMessage
}
);
return Task.CompletedTask;
}
}
}