diff --git a/Tapeti/Default/PublishResultBinding.cs b/Tapeti/Default/PublishResultBinding.cs index 38d5ff8..d02d087 100644 --- a/Tapeti/Default/PublishResultBinding.cs +++ b/Tapeti/Default/PublishResultBinding.cs @@ -38,6 +38,16 @@ namespace Tapeti.Default } + + // ReSharper disable once UnusedMember.Local - used implicitly above + private static async Task PublishGenericTaskResult(IMessageContext messageContext, object value) where T : class + { + var message = await (Task)value; + if (message != null) + await Reply(message, messageContext); + } + + private static Task Reply(object message, IMessageContext messageContext) { var publisher = (IInternalPublisher)messageContext.DependencyResolver.Resolve(); diff --git a/Test/MarcoController.cs b/Test/MarcoController.cs index da2ddab..4ced01e 100644 --- a/Test/MarcoController.cs +++ b/Test/MarcoController.cs @@ -120,9 +120,10 @@ namespace Test * This will automatically include the correlationId in the response and * use the replyTo header of the request if provided. */ - public PoloConfirmationResponseMessage PoloConfirmation(PoloConfirmationRequestMessage message) + public async Task PoloConfirmation(PoloConfirmationRequestMessage message) { Console.WriteLine(">> PoloConfirmation (returning confirmation)"); + await Task.Delay(100); return new PoloConfirmationResponseMessage {