I have setup my request client (which is a Console application) as shown in below code:
try
{
var bus = Bus.Factory.CreateUsingAzureServiceBus(sbc => { sbc.Host(ServiceBusConnectionString); });
await bus.StartAsync(); // This one is required to get response
var client =
bus.CreateRequestClient<MyRequest>(new Uri("queue:" + MyQueueName), TimeSpan.FromSeconds(50));
var response = await client.GetResponse<MyRequestResponse>(myRequest); //we should get the response here
Console.WriteLine(response.Message.mydata);
await Task.Run(() => Console.ReadKey());
await bus.StopAsync();
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
I'm expecting response from Consumer but I always end-up on response timeout error.
Please note:
I can see that the Consumer is receiving message perfectly.Consumer response code:
await context.RespondAsync(new MyRequestResponse(mydata));If I send custom exception from Consumer , client catch the exception immediately after sending request.
Most probably I'm missing some silly configuration. Any help?