1

I'm trying to get a basic PoC app running with MassTransit using our Amazon MQ instance, and running into the following problem when I call StartAsync on IBusControl:

MassTransit.ActiveMqTransport.ActiveMqConnectException: Connection exception: (user)@(host) ---> Apache.NMS.NMSConnectionException: Error connecting to (host) ---> System.Net.Sockets.SocketException (0xFFFFFFFE): Unknown error (0xfffffffe) at Apache.NMS.ActiveMQ.Transport.Tcp.TcpTransportFactory.DoConnect(String host, Int32 port, String localAddress, Int32 localPort)

Note: In the exception above, I've edited the items in bold to remove sensitive information. We know that the credentials we are using are in fact correct since we have integration tests for NMS and ActiveMq that use the same credentials. But when trying to connect using MassTransit, we get the above error.

I've tried a number of different approaches but they all produce the same result. Here's some example code to give a general idea of how we're trying to connect:

var busControl = Bus.Factory.CreateUsingActiveMq(configurator =>
            {
                configurator.Host(host, activeMqHostConfigurator =>
                {
                    activeMqHostConfigurator.Username(activeMqConfiguration.UserName);
                    activeMqHostConfigurator.Password(activeMqConfiguration.Password);
                });
            });
await busControl.StartAsync(new CancellationTokenSource(TimeSpan.FromSeconds(10)).Token);

The call to StartAsync is what throws the exception. I have my doubts that this is an issue with MassTransit, it's more likely something that I'm missing but I cannot see what's wrong, and I've had my team review it as well.

  • Be sure to call UseSsl() (required by AWS) and ensure the correct port is specified for SSL. – Chris Patterson Jul 09 '20 at 19:54
  • According to https://masstransit-project.com/usage/transports/activemq.html SSL is automatically configured for AWS. In addition I've tried it with and without UseSsl, same result. Also I can see in the exception details that the correct port is being used (I've omitted those details in my post however). – Jon Droniak Jul 09 '20 at 20:08
  • Firewall? Right VPC? Some network/visibility concern related to AWS? – Chris Patterson Jul 09 '20 at 21:44
  • So I've gotten to the bottom of this. Basically, it turns out that our hosts are part of a failover cluster that was configured to have one active and one inactive host. I happened to pick the inactive host when trying connect without realizing it. As a side note - is it possible to get a better exception for this scenario? It would have been nice to know that I was trying to connect to an inactive host. I'm not sure if that's possible though. – Jon Droniak Jul 10 '20 at 16:58

1 Answers1

0

As I mentioned in my comment this ended up not being related to MassTransit. It was due to the host being inactive.