C#에서 MONO라는 매우 간단한 RabbitMQ 클라이언트를 구현할 때 문제가 발생했습니다. 나는 다음과 같은 환경을 사용하고 있습니다 : OS : 우분투 16.04 MonoDevelop : 5.10 .NET 어셈블리 : RabbitMQ.Client.dll 버전 3.6.5.0MONO에서 RabbitMQ 클라이언트를 구현할 때의 문제
을 나는 RabbitMQ 서버가 내 PC에서 실행해야합니다. 나는 명령을 실행하면
sudo rabbitmqctl status
나는 이것은 물론 내가 "테스트"를 만든
using System;
using RabbitMQ.Client;
namespace provaRabbit
{
class MainClass
{
public static void Main (string[] args)
{
var factory = new ConnectionFactory();
factory.HostName = "localhost";
factory.UserName = "test";
factory.Password = "test";
factory.VirtualHost = ConnectionFactory.DefaultVHost;
factory.Port = AmqpTcpEndpoint.UseDefaultPort;
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 = System.Text.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();
}
}
}
매우 간단한 클라이언트의 C# 코드는
Status of node '[email protected]' ...
[{pid,9948},
{running_applications,
[{rabbitmq_management,"RabbitMQ Management Console","3.6.5"},
{rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.6.5"},
{webmachine,"webmachine","1.10.3"},
{mochiweb,"MochiMedia Web Server","2.13.1"},
{ssl,"Erlang/OTP SSL application","7.3"},
{public_key,"Public key infrastructure","1.1.1"},
{crypto,"CRYPTO","3.6.3"},
{rabbitmq_management_agent,"RabbitMQ Management Agent","3.6.5"},
{asn1,"The Erlang ASN1 compiler version 4.0.2","4.0.2"},
{compiler,"ERTS CXC 138 10","6.0.3"},
{amqp_client,"RabbitMQ AMQP Client","3.6.5"},
{inets,"INETS CXC 138 49","6.2"},
{syntax_tools,"Syntax tools","1.7"},
{rabbit,"RabbitMQ","3.6.5"},
{mnesia,"MNESIA CXC 138 12","4.13.3"},
{os_mon,"CPO CXC 138 46","2.4"},
{rabbit_common,[],"3.6.5"},
{ranch,"Socket acceptor pool for TCP protocols.","1.2.1"},
{xmerl,"XML parser","1.3.10"},
{sasl,"SASL CXC 138 11","2.7"},
{stdlib,"ERTS CXC 138 10","2.8"},
{kernel,"ERTS CXC 138 10","4.2"}]},
{os,{unix,linux}},
{erlang_version,
"Erlang/OTP 18 [erts-7.3] [source] [64-bit] [smp:2:2] [async-threads:64] [kernel-poll:true]\n"},
{memory,
[{total,55360120},
{connection_readers,0},
{connection_writers,0},
{connection_channels,0},
{connection_other,2712},
{queue_procs,2712},
{queue_slave_procs,0},
{plugins,389184},
{other_proc,18455960},
{mnesia,68360},
{mgmt_db,424248},
{msg_index,51504},
{other_ets,1445848},
{binary,98976},
{code,27797472},
{atom,1000601},
{other_system,5622543}]},
{alarms,[]},
{listeners,[{clustering,25672,"::"},{amqp,5672,"::"}]},
{vm_memory_high_watermark,0.4},
{vm_memory_limit,1549926400},
{disk_free_limit,50000000},
{disk_free,231269703680},
{file_descriptors,
[{total_limit,924},{total_used,2},{sockets_limit,829},{sockets_used,0}]},
{processes,[{limit,1048576},{used,229}]},
{run_queue,0},
{uptime,5890},
{kernel,{net_ticktime,60}}]
다음과 같은 결과를 얻을 수 사용자가 관련 암호를 사용하여 관리자 권한을 부여했습니다. 나는 사람이 어떤 제안이 있습니까
RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable ---> System.MissingMethodException: Method 'IPAddress.MapToIPv6' not found.
at System.Linq.Enumerable+WhereSelectArrayIterator`2[TSource,TResult].MoveNext() [0x0004d] in <filename unknown>:0
at System.Linq.Buffer`1[TElement]..ctor (IEnumerable`1 source) [0x00087] in <filename unknown>:0
at System.Linq.Enumerable.ToArray[TSource] (IEnumerable`1 source) [0x00011] in <filename unknown>:0
at RabbitMQ.Client.TcpClientAdapter.BeginConnect (System.String host, Int32 port, System.AsyncCallback requestCallback, System.Object state) [0x00044] in <filename unknown>:0
at RabbitMQ.Client.Impl.SocketFrameHandler.Connect (ITcpClient socket, RabbitMQ.Client.AmqpTcpEndpoint endpoint, Int32 timeout) [0x0000f] in <filename unknown>:0
at RabbitMQ.Client.Impl.SocketFrameHandler..ctor (RabbitMQ.Client.AmqpTcpEndpoint endpoint, System.Func`2 socketFactory, Int32 connectionTimeout, Int32 readTimeout, Int32 writeTimeout) [0x0003f] in <filename unknown>:0
at RabbitMQ.Client.Framing.Impl.ProtocolBase.CreateFrameHandler (RabbitMQ.Client.AmqpTcpEndpoint endpoint, System.Func`2 socketFactory, Int32 connectionTimeout, Int32 readTimeout, Int32 writeTimeout) [0x00000] in <filename unknown>:0
at RabbitMQ.Client.ConnectionFactory.CreateFrameHandler (RabbitMQ.Client.AmqpTcpEndpoint endpoint) [0x00005] in <filename unknown>:0
at RabbitMQ.Client.ConnectionFactory.CreateConnection (IList`1 endpoints, System.String clientProvidedName) [0x0007e] in <filename unknown>:0
--- End of inner exception stack trace ---
at RabbitMQ.Client.ConnectionFactory.CreateConnection (IList`1 endpoints, System.String clientProvidedName) [0x0009b] in <filename unknown>:0
at RabbitMQ.Client.ConnectionFactory.CreateConnection (IList`1 hostnames, System.String clientProvidedName) [0x0001d] in <filename unknown>:0
at RabbitMQ.Client.ConnectionFactory.CreateConnection() [0x00013] in <filename unknown>:0
at provaRabbit.MainClass.Main (System.String[] args) [0x00029] in /home/federico/Scrivania/rabbitMQ/provaRabbit/provaRabbit/Program.cs:16
다음과 같은 예외를 얻을 프로그램을 디버깅 할 때?
감사
페데리코
첫째, 답장을 보내 주셔서 감사합니다. 15672 포트에서 웹 관리자에 액세스 할 수 있으므로 RabbitMQ 서버가 실행 중이며 시스템이 셸 명령에 응답합니다. connectionFactory.RequestedConnectionTimeout 속성을 120000으로 변경하려고했지만 동일한 결과를 얻었습니다. –