@@ -40,6 +40,7 @@ public class AmqpConnection : AbstractLifeCycle, IConnection
4040
4141 private readonly Dictionary < string , object > _connectionProperties = new ( ) ;
4242 private bool _areFilterExpressionsSupported = false ;
43+ private FeatureFlags _featureFlags = new FeatureFlags ( ) ;
4344
4445 /// <summary>
4546 /// _publishersDict contains all the publishers created by the connection.
@@ -90,6 +91,7 @@ public static async Task<IConnection> CreateAsync(ConnectionSettings connectionS
9091 AmqpConnection connection = new ( connectionSettings , metricsReporter ) ;
9192 await connection . OpenAsync ( )
9293 . ConfigureAwait ( false ) ;
94+
9395 return connection ;
9496 }
9597
@@ -189,6 +191,7 @@ await OpenConnectionAsync(CancellationToken.None)
189191 . ConfigureAwait ( false ) ;
190192 await base . OpenAsync ( )
191193 . ConfigureAwait ( false ) ;
194+ _featureFlags . Validate ( ) ;
192195 }
193196
194197 public override async Task CloseAsync ( )
@@ -665,10 +668,11 @@ private void HandleProperties(Fields properties)
665668 }
666669
667670 string brokerVersion = ( string ) _connectionProperties [ "version" ] ;
668- if ( false == Utils . Is4_0_OrMore ( brokerVersion ) )
669- {
670- // TODO Java client throws exception here
671- }
671+ _featureFlags . IsBrokerCompatible = Utils . Is4_0_OrMore ( brokerVersion ) ;
672+
673+ // check if the broker supports filter expressions
674+ // this is a feature that was introduced in RabbitMQ 4.2.0
675+ _featureFlags . IsSqlFeatureEnabled = Utils . Is4_2_OrMore ( brokerVersion ) ;
672676
673677 _areFilterExpressionsSupported = Utils . SupportsFilterExpressions ( brokerVersion ) ;
674678 }
0 commit comments