public override Task <PublishReply> PublisherMessage(PublishRequest request, ServerCallContext context) { Console.WriteLine($"Received: {request.Topic} {request.Content}"); var message = new Message(request.Topic, request.Content); _messageStorage.Add(message); return(Task.FromResult(new PublishReply() { IsSuccess = true })); }
public override async Task <PublishResponse> PublishMessage(PublishCommand command, ServerCallContext context) { var message = Message.From(command); _messageStorageService.Add(message); await _messageSender.SendMessageAsync(message); return(new PublishResponse { IsSucceed = true }); }