Closed volethanh closed 2 years ago
Could you maybe post the exception here, including the full stack trace?
This is my full stack trace and exception
Hi @mookid8000 , Is there anything you find out ?
No sorry, I haven't figure anything out.
Could you make it work somehow? What did you change to do that?
No sorry, I haven't figure anything out.
Did you try using the connection from AmazonMQ for RabbitMQ ?
Could you make it work somehow? What did you change to do that?
As you see in the first picture, I've changed the the param pass to the method CreateConnection
from CreateConnection(IList<AmqpTcpEndpoint> endpoints)
to CreateConnection(string clientProvidedName)
Did you try using the connection from AmazonMQ for RabbitMQ ?
No.
As you see in the first picture, I've changed the the param pass to the method CreateConnection from CreateConnection(IList
endpoints) to CreateConnection(string clientProvidedName)
Ok, great. How do you suggest this is solved?
I'm also having an issue connecting to AmazonMQ, but I'm not 100% sure I'm using a proper ConnectionEndpoint for SSL. Does this look reasonable in terms of how one would connect to an SSL based rabbitmq?
var ConnectionString = "amqps://username:password@some-guid.mq.us-east-1.amazonaws.com:5671";
var serverConnectionEndpoints = new List<ConnectionEndpoint>
{
new()
{
ConnectionString = ConnectionString,
SslSettings = new SslSettings(true, "*.mq.us-east-1.amazonaws.com")
}
};
using var publisher = new BuiltinHandlerActivator();
var publisherBus = Configure.With(publisher)
.Logging(l => l.ColoredConsole(MinimumLogLevel))
.Transport(t =>
{
t.UseRabbitMqAsOneWayClient(serverConnectionEndpoints);
})
.Start();
I have been able to successfully connect to the same AmazonMQ instance by just using a the plain old C# RabbitMQ client.
I'm guessing that the OP's issue was that they weren't supplying SslSettings
, as I was getting the same network timeout exception before switching my code to use List<ConnectionEndpoint>
when setting up the rebus rabbitmq client.
I think I figured out a way around this (or at least my) issue:
var sslSettings = new SslSettings(true, "*.mq.us-east-1.amazonaws.com")
{
Version = SslProtocols.Tls12
};
It looks like the defaults for CertPassphrase
is set to ""
and Version
is defaulted to TLS
when constructing the SslOptions
instance in Rebus. The instance in my vanilla RabbitMQ.Client was null
for CertPassphrase
and None
for Version
.
I missed these overrides when debugging before I posted my original comment, but I think I'm all up and running now.
Ah great, I'm happy to hear that 🙂
I think I figured out a way around this (or at least my) issue:
var sslSettings = new SslSettings(true, "*.mq.us-east-1.amazonaws.com") { Version = SslProtocols.Tls12 };
It looks like the defaults for
CertPassphrase
is set to""
andVersion
is defaulted toTLS
when constructing theSslOptions
instance in Rebus. The instance in my vanilla RabbitMQ.Client wasnull
forCertPassphrase
andNone
forVersion
.I missed these overrides when debugging before I posted my original comment, but I think I'm all up and running now.
Thanks @sherzberg , I've tried and it run successfully
Hi,
I'm using Rebus.RabbitMq and connect to AmazonMQ for RabbitMQ service. The connection is amqps and the Exception was throw in the GetConnection method. When I changed and don't use _amqpTcpEndpoints, It works.
How can I solve this problem ? Thanks