0
我使用RabbitAdapter類中的RabbitBus.BusBuilder創建RabbitBus.Bus。無法將RabbitBus連接到RabbitMQ
public class RabbitAdapter
{
private Bus _bus;
public RabbitAdapter()
{
// The exchange and queue values are the same as what I see in RabbitMQ in browser
_bus = new BusBuilder()
.Configure(ctx => ctx.Consume<StatusUpdate>()
.WithExchange("exchange")
.WithQueue("Log"))
.Build();
}
public void Init()
{
// The [url] and [port] values are the same as what I see in browser
_bus.Connect("amqp://guest:[email protected][url]:[port]/#/", TimeSpan.FromSeconds(10));
_bus.Subscribe<StatusUpdate>(OnHandle);
}
private void OnHandle(IMessageContext<StatusUpdate> statusUpdateContext)
{
Console.WriteLine(statusUpdateContext.Id);
}
public void Start()
{
}
}
我知道我可能只是在這裏失去了一些東西。總線中的_connectionFactory不爲null,但_connection爲。它似乎超時,我甚至試圖讓超時一分鐘。
是的,這聽起來像問題。 –