public void can_shutdown_and_restart_connections_on_seperate_threads() { new MessagingBaseConfiguration() .WithDefaults() .WithConnection(ConfigurationHelpers.RabbitMqConnectionWithConfigSettings()); var anyFails = false; var b = new Thread(() => { for (int i = 0; i < 100; i++) { _conn.Dispose(); Thread.Sleep(100); } }); var a = new Thread(() => { for (int i = 0; i < 100; i++) { if (!_conn.GetWithChannel(c => c.IsOpen)) { anyFails = true; } Thread.Sleep(100); } }); a.Start(); b.Start(); Assert.That(a.Join(TimeSpan.FromSeconds(20))); Assert.That(b.Join(TimeSpan.FromSeconds(20))); Assert.False(anyFails, "channel was closed during an operation"); }
public void setup() { var config = new MessagingBaseConfiguration() .WithDefaults() .WithConnection(ConfigurationHelpers.RabbitMqConnectionWithConfigSettings()); _conn = config.Get <IChannelAction>(); }
public void setup() { _config = new MessagingBaseConfiguration() .WithDefaults() //.UsesSecureConnections() // If you don't have HTTPS set up, comment out this line .WithConnection(ConfigurationHelpers.RabbitMqConnectionWithConfigSettings()); _messaging = _config.GetMessagingBase(); _query = ConfigurationHelpers.RabbitMqQueryWithConfigSettings(); }
public void can_repeatedly_configure_and_shutdown_messaging() { for (int i = 0; i < 20; i++) { var config = new MessagingBaseConfiguration() .WithDefaults() .WithConnection(ConfigurationHelpers.RabbitMqConnectionWithConfigSettings()); config.Shutdown(); } }
public void setup() { _config = new MessagingBaseConfiguration() .WithDefaults() .UsesSecureConnections() .WithConnection(ConfigurationHelpers.RabbitMqConnectionWithConfigSettings()); _messaging = _config.GetMessagingBase(); _query = ConfigurationHelpers.RabbitMqQueryWithConfigSettings(); }
public void setup() { _config = new MessagingBaseConfiguration() .WithDefaults() .SetDefaultAcknowledgeTimeout(TimeSpan.FromSeconds(1)) .WithConnection(ConfigurationHelpers.RabbitMqConnectionWithConfigSettings()); var msg = _config.GetMessagingBase(); msg.CreateDestination <IMetadataFile>("ReleaseTestQueue", Expires.Never); msg.SendMessage(new SuperMetadata()); }
public void ssl_defaul_strictness_settings_are_set_to_strict() { _config = new MessagingBaseConfiguration() .WithDefaults() .UsesSecureConnections() // default .WithConnection(ConfigurationHelpers.RabbitMqConnectionWithConfigSettings()) .WithRabbitManagement("localhost", 0, "", "", "/", ""); var firstInstance = (RabbitMqQuery)_config.GetManagement(); var secondInstance = (RabbitMqQuery)_config.GetManagement(); Assert.That(firstInstance?.AcceptInvalidSsl, Is.False, "First instance was relaxed, but expected strict"); Assert.That(secondInstance?.AcceptInvalidSsl, Is.False, "First instance was relaxed, but expected strict"); }
public void ssl_relaxed_strictness_settings_are_persistent() { _config = new MessagingBaseConfiguration() .WithDefaults() .UsesSecureConnections(SslConnectionStrictness.Relaxed) .WithConnection(ConfigurationHelpers.RabbitMqConnectionWithConfigSettings()) .WithRabbitManagement("localhost", 0, "", "", "/", ""); var firstInstance = (RabbitMqQuery)(_config.GetManagement()); var secondInstance = (RabbitMqQuery)(_config.GetManagement()); Assert.That(firstInstance?.AcceptInvalidSsl, Is.True, "First instance was strict, but expected relaxed"); Assert.That(secondInstance?.AcceptInvalidSsl, Is.True, "First instance was strict, but expected relaxed"); }
public void A_configured_messaging_base() { messaging = new MessagingBaseConfiguration() .WithDefaults() //.WithContractRoot<...some type...>() // by omitting this, we force the system to discover types itself. .WithConnection(ConfigurationHelpers.RabbitMqConnectionWithConfigSettings()) .GetMessagingBase(); testMessage = new SuperMetadata { CorrelationId = Guid.NewGuid(), Contents = "These are my ||\"\\' ' contents: ⰊⰄⰷἚ𐰕𐰑ꔘⶤعبػػ↴↳↲↰", FilePath = @"C:\temp\", HashValue = 893476, MetadataName = "KeyValuePair" }; }
public void A_configured_messaging_base() { messaging = new MessagingBaseConfiguration() .WithDefaults() .WithContractRoot <IMsg>() .WithConnection(ConfigurationHelpers.RabbitMqConnectionWithConfigSettings()) .WithApplicationGroupName("app-group-name") .GetMessagingBase(); testMessage = new SuperMetadata { CorrelationId = Guid.NewGuid(), Contents = "This is my message", FilePath = @"C:\temp\", HashValue = 893476, MetadataName = "KeyValuePair" }; }