Search code examples
.netamazon-web-servicesactivemq-classicsocketexceptionapache-nms

SocketException with AmazonMQ with .NET Core 2.2


I get a SocketException just trying to create a connection to AmazonMQ with the NMS ActiveMQ .net nuget package. Here is how I'm trying to connect:

string url = "ssl://amazoninstance:61617";
string userName = "un";
string password = "pw;

var transport = transportFactory.CreateTransport(new Uri(url)); // Error's out here
var connection = new Connection(new Uri(url), transport, new IdGenerator());
connection.UserName = userName;
connection.Password = password;
var session = connection.CreateSession(AcknowledgementMode.AutoAcknowledge);

My brokers "Public Accessibility" is set to "Yes". I've also opened up the inbound security groups so it should be able to receive connections from my IP. Any input on what I might be missing would be appreciated.


Solution

  • Just heard back from Amazon. I had the security groups setup to only allow all IPv6 connections. IPv4 was still being blocked. Fixing that resolved my issue.