I'm having problem with MassTransit in Request-Respond model (using MassTransit.RabbitMQ 3.0.14).
TLDR; Request-Respond does not work when response type is List/IEnumerable.
In client I'm creating instance of IRequestClient:
var RequestObjects = busControl.CreateRequestClient<MyObjectsRequest, List<MyObject>>(
new Uri(configuration["MassTransit:ServerAddress"] + "/" + configuration["MassTransit:TestQueueName"]),
TimeSpan.FromSeconds(15));
Next, I call server for a response:
RequestObjects.Request(new MyObjectsRequest{ Id = 1 });
On server side I have registered consumer:
public async Task Consume(ConsumeContext<MyObjectRequest> context)
{
var myList = new List<MyObject>
{
new MyObject { Id = 1 },
new MyObject { Id = 2 }
}
context.Respond(myList);
}
And the problem is that response go to some temporary _skipped queue (I'm tracking it via RabbitMQ's web panel) and I'm getting RequestTimeOutException.
I've tried also with IEnumerable<> - same thing.
In fact, Array<MyObject> works well - response is going back to my client.
AFAIR when I was using MassTransit 2.x subscribing on Lists worked well. Is there a possibility to do the same on MassTransit 3.x?
What's curious, the message type seems to be erased when it's getting to RabbitMQ while I'm using List/IEnumerable:
The snippet of the messageType when single object is sent:
And the snippet of the messageType when Array of the objects is sent:


