Just trying to get the tutorial to work. I'm on windows 10 with VS 2017, with both erlag and rabbitmq installed and running.
using System;
using RabbitMQ.Client;
using System.Text;
class Program
{
public static void Main()
{
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();
}
}
RabbitMQ.Client.Exceptions.BrokerUnreachableException occurred
HResult=0x80131620
Message=None of the specified endpoints were reachable
Source=RabbitMQ.Client
StackTrace:
at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName)
at RabbitMQ.Client.ConnectionFactory.CreateConnection()
at Program.Main() in C:\Working\Development\dotnet-visual-studio\1_Send\Program.cs:line 10
Inner Exception 1:
ConnectFailureException: Connection failed
Inner Exception 2:
SocketException: No connection could be made because the target machine actively refused it
I need to get this to work for a demo next week.
Cheers
Ozi