2019-08-16 08:51:35 +00:00
|
|
|
|
using System;
|
|
|
|
|
using ExampleLib;
|
|
|
|
|
using Messaging.TapetiExample;
|
2023-04-14 13:47:27 +00:00
|
|
|
|
using Tapeti.Config.Annotations;
|
2019-08-16 08:51:35 +00:00
|
|
|
|
|
|
|
|
|
namespace _01_PublishSubscribe
|
|
|
|
|
{
|
|
|
|
|
[MessageController]
|
|
|
|
|
[DynamicQueue("tapeti.example.01")]
|
|
|
|
|
public class ExampleMessageController
|
|
|
|
|
{
|
|
|
|
|
private readonly IExampleState exampleState;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ExampleMessageController(IExampleState exampleState)
|
|
|
|
|
{
|
|
|
|
|
this.exampleState = exampleState;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void HandlePublishSubscribeMessage(PublishSubscribeMessage message)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("Received message: " + message.Greeting);
|
|
|
|
|
exampleState.Done();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|