MassTransit 6.2.4. RabbitMQ. The regression in UseCluster() with the custom SSL settings or the default port.

Created on 21 Apr 2020  路  9Comments  路  Source: MassTransit/MassTransit

The change introduced with the https://github.com/MassTransit/MassTransit/issues/1784 change not only removed the ClustersMembers property from the IRabbitMqClusterConfigurator interface but introduces a regression in the nodes connection configuration.

Before the 6.2.4 (in 6.2.3 at least), the SSL settings (as well as port) were propagated to the instance of AmqpTcpEndpoint from the global settings during the invocation of the ConnectionFactory.CreateConnection.
We the replacement of the EndpointResolver we now always using the default SSL settings and have no way to override it in the configuration.

https://github.com/MassTransit/MassTransit/blob/f78178a0ef056c09f55c6efd8fb0ccdc1bc508d2/src/MassTransit.RabbitMqTransport/Configuration/Configurators/RabbitMqHostConfigurator.cs#L89

Also, it's better to consider bumping the minor version with such a set of changes:

  • Removal of the configuration property without deprecation.
  • Changing of the behavior for the port propagation.
  • Changing the behavior of the SSL settings propagation.
rabbitmq

Most helpful comment

@phatboyg Both issues seem to be resolved with the provided fix.
Thanks for so fast response!

All 9 comments

Could you explain what it is you need, or post code that was working previously that no longer works? I'm happy to restore the ability to override the resolver, that change wasn't intentional. But the ability to specify host name and port was necessary.

@phatboyg we have:

  1. UseCluster configuration without port preparation:
    Previous behavior: port if defined from the host URI string.
    Current behavior: 5672 is used.
    Workaround: Propagate port with the host address.
  2. UseCluster in combination with the UseSsl with custom settings (for example, with the SSL check relaxation).
    Previous behavior - propagated from the ConfigurationHostSettings
    Current behavior - new SslOptions() is used.

I reviewed the code, and honestly I don't see how _this_ change would have eliminate the propagation of SslOptions to the endpoint. I looked at how RabbitMQ.Client is used, and it has always created a new SslOption for each endpoint in the cluster.

If you are saying that YOUR CODE previously did this, and now you can't, I missed that in the response above.

Regardless of how it happened, I'll commit a change that copies all the settings into each endpoint.

Once the develop packages are built, you're welcome to test it out and verify it meets your requirements. I really have no way to test your scenario.

If you are saying that YOUR CODE previously did this, and now you can't, I missed that in the response above.

I guess it's not relevant anymore with your change, but I will try to explain.

It's unrelated to a specific code.
Previously, ClustersMembers were used directly in several places and were only used as a source of hostnames, but not AmqpTcpEndpoint endpoints. During the creation of the connection, the configuration was propagated to the instance of the AmqpTcpEndpoint in the ConnectionFactory class. In 6.2.4 there is no way to propagate this configuration into the AmqpTcpEndpoint instance.

Oh, so by passing the array of names into the ConnectionFactory, the connection factory was copying the values the way I'm copying them now? Got it. I'll double check the source to make sure I have them all and call this good.

Right, and the change I just committed replicates that previous behavior by copying the Ssl and Port values from the settings.

@phatboyg Both issues seem to be resolved with the provided fix.
Thanks for so fast response!

Was this page helpful?
0 / 5 - 0 ratings