在按照他們網(wǎng)站上的教程到下面是我的代碼之后,我無(wú)法連接到 rabbitMQ 服務(wù)器。var factory = new ConnectionFactory() { HostName = "localhost" }; using(var connection = factory.CreateConnection()) using(var channel = connection.CreateModel()) { channel.QueueDeclare(queue: "hello", durable: false, exclusive: false, autoDelete: false, arguments: null); string message = "Hello World!"; var body = Encoding.UTF8.GetBytes(message); channel.BasicPublish(exchange: "", routingKey: "hello", basicProperties: null, body: body); Console.WriteLine(" [x] Sent {0}", message); } Console.WriteLine(" Press [enter] to exit."); Console.ReadLine();
1 回答

慕蓋茨4494581
TA貢獻(xiàn)1850條經(jīng)驗(yàn) 獲得超11個(gè)贊
BrokerUnreachableException
表示客戶端無(wú)法訪問(wèn)服務(wù)器。
檢查服務(wù)器是否實(shí)際啟動(dòng)并運(yùn)行,或者您是否有一些防火墻配置。
有幾篇關(guān)于的帖子BrokerUnreachableException
,例如關(guān)注這個(gè)關(guān)于那個(gè)的帖子
- 1 回答
- 0 關(guān)注
- 315 瀏覽
添加回答
舉報(bào)
0/150
提交
取消