0
我試圖在Consumer.Consume方法中啓動請求/響應,並且正努力填充總線參數。在消費者中啓動請求/響應模式
public class DeleteUserConsumer : IConsumer<IDeleteUser>
{
public async Task Consume(ConsumeContext<IDeleteUser> context)
{
var address = "rabbitmq://host/vhost/queue"
var timeout = TimeSpan.FromSeconds(15);
var bus = context.??? // was hoping to get an IBusControl instance from the context - but perhaps this isn't possible?
IRequestClient<IGetUserDetails,IUserDetails> client = new MessageRequestClient<IGetUserDetails, IUserDetails>(bus, address, timeout);
var userDetails = await client.Request(new IGetUserDetails() {Name = context.Message.Name});
}
}
忽略任意例子,有沒有任何機制去IBusControl的實例的引用跨傳遞給MessageRequestClient構造?