I have created a sample pub/sub that works on the local machine. When creating an instance of the ConnectionFactory, I pass it the HostName of "localhost" as illustrated below:
RabbitMQ.Client.Exceptions.BrokerUnreachableException was unhandled
Message=None of the specified endpoints were reachable
Source=RabbitMQ.Client
StackTrace:
at RabbitMQ.Client.ConnectionFactory.CreateConnection()
at Producer.PubSubServiceBusEndPoint..ctor(String queueName, String brokerHostName) in c:\dev\src\oss\RabbitMqTutorials\Producer\PubSubServiceBusEndPoint.cs:line 25
at Producer.Program.Main() in c:\dev\src\oss\RabbitMqTutorials\Producer\Program.cs:line 7
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: RabbitMQ.Client.Exceptions.ConnectFailureException
Message=Connection failed
Source=RabbitMQ.Client
StackTrace:
at RabbitMQ.Client.Impl.SocketFrameHandler.Connect(TcpClient socket, AmqpTcpEndpoint endpoint, Int32 timeout)
at RabbitMQ.Client.Impl.SocketFrameHandler..ctor(AmqpTcpEndpoint endpoint, ObtainSocket socketFactory, Int32 timeout)
at RabbitMQ.Client.Framing.Impl.ProtocolBase.CreateFrameHandler(AmqpTcpEndpoint endpoint, ObtainSocket socketFactory, Int32 timeout)
at RabbitMQ.Client.ConnectionFactory.CreateFrameHandler()
at RabbitMQ.Client.ConnectionFactory.CreateConnection()
InnerException: System.Net.Sockets.SocketException
Message=A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond aaa.bbb.40.176:5672
Source=System
ErrorCode=10060
NativeErrorCode=10060
StackTrace:
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.TcpClient.EndConnect(IAsyncResult asyncResult)
at RabbitMQ.Client.Impl.SocketFrameHandler.Connect(TcpClient socket, AmqpTcpEndpoint endpoint, Int32 timeout)
InnerException:
Is this a firewall issue?