Luke/Michael,
I am using user/pass provided to me by epex spot. And i am able to connect to the server with the provided credentials. Also, i have set user id on the basic properties while sending message. Still i am not able to DeclareExchange or DeclareQueue. Is there something i am missing with the request i am making? As initial connection created is successful but anything further than that closes the channel.
Following is the line of codes :
ConnectionFactory factory = new RabbitMQ.Client.ConnectionFactory();
string queueName,exchangeName;
string tradeXML;
var body = Encoding.UTF8.GetBytes("Hello World");
Guid gl;
gl = Guid.NewGuid();
exchangeName = "M7.echangeName.username"; //+ DateTime.Now.ToString("yyyyMMddHHmmss");
queueName = "M7.private.responseName.username." + gl;
factory.UserName = "username";
factory.Password = "password";
factory.VirtualHost = "app";
factory.HostName = "hostURL";
factory.Port = 1800;
factory.AutomaticRecoveryEnabled = true;
factory.Protocol = Protocols.AMQP_0_9_1;
factory.RequestedHeartbeat = 60;
factory.Ssl.Enabled = true;
factory.Ssl.ServerName =
factory.Ssl.CertPath = @"certpath";
factory.Ssl.CertPassphrase = "CertPassword";
factory.Ssl.Version = System.Security.Authentication.SslProtocols.Tls12;
factory.Ssl.ServerName = "servernameURL";
var properties = new Dictionary<String, Object>
{
{"AppId","provided_appID"},
{"CorrelationId",gl.ToString()},
{"ContentType","x-m7/request; version=6"},
{"UserId","username"},
{"ReplyTo",queueName},
{"ClientProvidedName","Prajwal"}
};
factory.ClientProperties = properties;
using (IConnection conn = factory.CreateConnection())
{
using (IModel channel = conn.CreateModel())
{
conn.AutoClose = true;
channel.BasicQos(0, 1, false);
channel.BasicAck(0, true);
IBasicProperties basicProperties = channel.CreateBasicProperties();
basicProperties.AppId = "provided_appID";