public object Any(Hello request)
 {
     return new HelloResponse { Result = "Hello, {0}!".Fmt(request.Name) };
 }
        public void Can_receive_and_process_standard_request_reply_combo()
        {
            var mqHost = CreateMqServer();

            string messageReceived = null;

            mqHost.RegisterHandler<Hello>(m =>
                new HelloResponse { Result = "Hello, " + m.GetBody().Name });

            mqHost.RegisterHandler<HelloResponse>(m => {
                messageReceived = m.GetBody().Result; return null;
            });

            mqHost.Start();

            var mqClient = mqHost.CreateMessageQueueClient();

            var dto = new Hello { Name = "ServiceStack" };
            mqClient.Publish(dto);

            Thread.Sleep(1000);

            Assert.That(messageReceived, Is.EqualTo("Hello, ServiceStack"));
        }
 public object Any(Hello request)
 {
     return(new HelloResponse {
         Result = "Hello, {0}!".Fmt(request.Name)
     });
 }