From 83e66d3ef7b80c9147352e195c0cdc44e946540c Mon Sep 17 00:00:00 2001 From: "toby.henderson" Date: Tue, 13 Jun 2017 17:54:31 +0100 Subject: [PATCH] Adds RoutingKey class --- .../Adapters/ServiceHost/DocumentService.cs | 6 +- .../Services/GenericListenerService.cs | 6 +- samples/GreetingsCoreConsole/Program.cs | 2 +- .../GreetingService.cs | 2 +- .../Connection.cs | 4 +- .../ConnectionBuilder.cs | 2 +- .../ControlBusReceiverBuilder.cs | 4 +- src/Paramore.Brighter/RoutingKey.cs | 98 +++++++++++++++++++ ..._to_connect_a_channel_and_handler_async.cs | 2 +- ...as_a_new_connection_added_while_running.cs | 4 +- ..._asked_to_connect_a_channel_and_handler.cs | 2 +- ...essage_dispatcher_restarts_a_connection.cs | 2 +- ...tion_after_all_connections_have_stopped.cs | 4 +- ...a_message_dispatcher_shuts_a_connection.cs | 2 +- ...er_starts_different_types_of_performers.cs | 4 +- ...e_dispatcher_starts_multiple_performers.cs | 2 +- .../When_building_a_dispatcher.cs | 4 +- ...uilding_a_dispatcher_with_named_gateway.cs | 4 +- 18 files changed, 126 insertions(+), 28 deletions(-) create mode 100644 src/Paramore.Brighter/RoutingKey.cs diff --git a/samples/DocumentsAndFolders.Sqs.WindowsService/Adapters/ServiceHost/DocumentService.cs b/samples/DocumentsAndFolders.Sqs.WindowsService/Adapters/ServiceHost/DocumentService.cs index e45919cdb7..a454c404df 100644 --- a/samples/DocumentsAndFolders.Sqs.WindowsService/Adapters/ServiceHost/DocumentService.cs +++ b/samples/DocumentsAndFolders.Sqs.WindowsService/Adapters/ServiceHost/DocumentService.cs @@ -104,7 +104,7 @@ public DocumentService() new InputChannelFactory(sqsMessageConsumerFactory, sqsMessageProducerFactory), typeof(DocumentCreatedEvent), new ChannelName("https://sqs.eu-west-1.amazonaws.com/027649620536/DocumentCreatedEvent"), - "DocumentCreatedEvent", + new RoutingKey("DocumentCreatedEvent"), timeoutInMilliseconds: 5000, noOfPerformers: 10), new Connection( @@ -112,7 +112,7 @@ public DocumentService() new InputChannelFactory(sqsMessageConsumerFactory, sqsMessageProducerFactory), typeof(DocumentUpdatedEvent), new ChannelName("https://sqs.eu-west-1.amazonaws.com/027649620536/DocumentUpdatedEvent"), - "DocumentUpdatedEvent", + new RoutingKey("DocumentUpdatedEvent"), timeoutInMilliseconds: 5000, noOfPerformers: 10), new Connection( @@ -120,7 +120,7 @@ public DocumentService() new InputChannelFactory(sqsMessageConsumerFactory, sqsMessageProducerFactory), typeof(FolderCreatedEvent), new ChannelName("https://sqs.eu-west-1.amazonaws.com/027649620536/FolderCreatedEvent"), - "FolderCreatedEvent", + new RoutingKey("FolderCreatedEvent"), timeoutInMilliseconds: 5000, noOfPerformers: 10) }; diff --git a/samples/GenericListener/Adapters/Services/GenericListenerService.cs b/samples/GenericListener/Adapters/Services/GenericListenerService.cs index 761416faf9..5799484527 100644 --- a/samples/GenericListener/Adapters/Services/GenericListenerService.cs +++ b/samples/GenericListener/Adapters/Services/GenericListenerService.cs @@ -129,9 +129,9 @@ Dispatcher BuildDispatcher(HandlerConfig handlers) var connections = new List { // Generic Events - new Connection(new ConnectionName("Task.Added"),inputChannelFactory, typeof(GenericTaskAddedEvent), new ChannelName("Task.Added"), "Task.Added", noOfPerformers:1, timeoutInMilliseconds: 200), - new Connection(new ConnectionName("Task.Edited"),inputChannelFactory, typeof(GenericTaskEditedEvent), new ChannelName("Task.Edited"), "Task.Edited", noOfPerformers:1, timeoutInMilliseconds: 200), - new Connection(new ConnectionName("Task.Completed"),inputChannelFactory, typeof(GenericTaskCompletedEvent), new ChannelName("Task.Completed"), "Task.Completed", noOfPerformers:1, timeoutInMilliseconds: 200), + new Connection(new ConnectionName("Task.Added"),inputChannelFactory, typeof(GenericTaskAddedEvent), new ChannelName("Task.Added"), new RoutingKey("Task.Added"), noOfPerformers:1, timeoutInMilliseconds: 200), + new Connection(new ConnectionName("Task.Edited"),inputChannelFactory, typeof(GenericTaskEditedEvent), new ChannelName("Task.Edited"), new RoutingKey("Task.Edited"), noOfPerformers:1, timeoutInMilliseconds: 200), + new Connection(new ConnectionName("Task.Completed"),inputChannelFactory, typeof(GenericTaskCompletedEvent), new ChannelName("Task.Completed"),new RoutingKey( "Task.Completed"), noOfPerformers:1, timeoutInMilliseconds: 200), }; return DispatchBuilder.With() diff --git a/samples/GreetingsCoreConsole/Program.cs b/samples/GreetingsCoreConsole/Program.cs index e9c85e47f4..19784696ee 100644 --- a/samples/GreetingsCoreConsole/Program.cs +++ b/samples/GreetingsCoreConsole/Program.cs @@ -75,7 +75,7 @@ public static void Main(string[] args) new InputChannelFactory(rmqMessageConsumerFactory, rmqMessageProducerFactory), typeof(GreetingEvent), new ChannelName("greeting.event"), - "greeting.event", + new RoutingKey("greeting.event"), timeoutInMilliseconds: 200) }; diff --git a/samples/GreetingsWindowsService/GreetingService.cs b/samples/GreetingsWindowsService/GreetingService.cs index d6fbaabeb3..55917d4b55 100644 --- a/samples/GreetingsWindowsService/GreetingService.cs +++ b/samples/GreetingsWindowsService/GreetingService.cs @@ -102,7 +102,7 @@ public GreetingService() new InputChannelFactory(rmqMessageConsumerFactory, rmqMessageProducerFactory), typeof(GreetingEvent), new ChannelName("greeting.event"), - "greeting.event", + new RoutingKey("greeting.event"), timeoutInMilliseconds: 200) }; diff --git a/src/Paramore.Brighter.ServiceActivator/Connection.cs b/src/Paramore.Brighter.ServiceActivator/Connection.cs index bc988782c5..59afe1a571 100644 --- a/src/Paramore.Brighter.ServiceActivator/Connection.cs +++ b/src/Paramore.Brighter.ServiceActivator/Connection.cs @@ -49,7 +49,7 @@ public class Connection /// Gets or sets the name. /// /// The name. - public string RoutingKey { get; set; } + public RoutingKey RoutingKey { get; set; } /// /// Gets the channel. @@ -119,7 +119,7 @@ public class Connection /// The number of unacceptable messages to handle, before stopping reading from the channel /// The channel name /// The durability of the queue - public Connection(ConnectionName name, IAmAChannelFactory channelFactory, Type dataType, ChannelName channelName, string routingKey, int noOfPerformers = 1, + public Connection(ConnectionName name, IAmAChannelFactory channelFactory, Type dataType, ChannelName channelName, RoutingKey routingKey, int noOfPerformers = 1, int timeoutInMilliseconds = 300, int requeueCount = -1, int requeueDelayInMilliseconds = 0, int unacceptableMessageLimit = 0, bool isDurable = false, bool isAsync = false) { diff --git a/src/Paramore.Brighter.ServiceActivator/ConnectionBuilder.cs b/src/Paramore.Brighter.ServiceActivator/ConnectionBuilder.cs index 2029e5deb5..3f9c0b2495 100644 --- a/src/Paramore.Brighter.ServiceActivator/ConnectionBuilder.cs +++ b/src/Paramore.Brighter.ServiceActivator/ConnectionBuilder.cs @@ -63,7 +63,7 @@ public Connection Build() _inputChannelFactory, _type, new ChannelName(_channelName), - _routingKey, + new RoutingKey(_routingKey), timeoutInMilliseconds: _milliseconds); } diff --git a/src/Paramore.Brighter.ServiceActivator/ControlBusReceiverBuilder.cs b/src/Paramore.Brighter.ServiceActivator/ControlBusReceiverBuilder.cs index 62c423fd07..9f291a2045 100644 --- a/src/Paramore.Brighter.ServiceActivator/ControlBusReceiverBuilder.cs +++ b/src/Paramore.Brighter.ServiceActivator/ControlBusReceiverBuilder.cs @@ -120,7 +120,7 @@ a base naming scheme to allow centralized management. _channelFactory, typeof(ConfigurationCommand), new ChannelName(hostName + "." + CONFIGURATION), - hostName + "." + CONFIGURATION + new RoutingKey(hostName + "." + CONFIGURATION) ); //var connectionConfiguration = new ConnectionConfiguration() //{ @@ -137,7 +137,7 @@ a base naming scheme to allow centralized management. _channelFactory, typeof(HeartbeatRequest), new ChannelName(hostName + "." + HEARTBEAT), - hostName + "." + HEARTBEAT, + new RoutingKey(hostName + "." + HEARTBEAT), isDurable:false ); diff --git a/src/Paramore.Brighter/RoutingKey.cs b/src/Paramore.Brighter/RoutingKey.cs new file mode 100644 index 0000000000..f72d67aca2 --- /dev/null +++ b/src/Paramore.Brighter/RoutingKey.cs @@ -0,0 +1,98 @@ +namespace Paramore.Brighter +{ + /// + /// The name of a Routing Key used to wrap communication with a Broker + /// + public class RoutingKey + { + /// + /// Initializes a new instance of the class. + /// + /// The name. + public RoutingKey(string name) + { + Value = name; + } + + /// + /// Gets the name of the channel as a string. + /// + /// The value. + public string Value { get; } + + /// + /// Returns a that represents this instance. + /// + /// A that represents this instance. + public override string ToString() + { + return Value; + } + + /// + /// Performs an implicit conversion from to . + /// + /// The RHS. + /// The result of the conversion. + public static implicit operator string(RoutingKey rhs) + { + return rhs.ToString(); + } + + /// + /// Do the routing key name's match? + /// + /// The other. + /// true if XXXX, false otherwise. + public bool Equals(RoutingKey other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return string.Equals(Value, other.Value); + } + + /// + /// Do the channel name's match? + /// + /// The object to compare with the current object. + /// true if the specified is equal to this instance; otherwise, false. + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((RoutingKey)obj); + } + + /// + /// Returns a hash code for this instance. + /// + /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + public override int GetHashCode() + { + return Value?.GetHashCode() ?? 0; + } + + /// + /// Implements the ==. Do the channel name's match? + /// + /// The left. + /// The right. + /// The result of the operator. + public static bool operator ==(RoutingKey left, RoutingKey right) + { + return Equals(left, right); + } + + /// + /// Implements the !=. Do the channel name's not match? + /// + /// The left. + /// The right. + /// The result of the operator. + public static bool operator !=(RoutingKey left, RoutingKey right) + { + return !Equals(left, right); + } + } +} diff --git a/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_Is_asked_to_connect_a_channel_and_handler_async.cs b/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_Is_asked_to_connect_a_channel_and_handler_async.cs index 6d09cc0e44..b7deb1461c 100644 --- a/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_Is_asked_to_connect_a_channel_and_handler_async.cs +++ b/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_Is_asked_to_connect_a_channel_and_handler_async.cs @@ -30,7 +30,7 @@ public MessageDispatcherRoutingAsyncTests() timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(_channel), channelName: new ChannelName("fakeChannel"), - routingKey: "fakekey", + routingKey: new RoutingKey("fakekey"), isAsync: true); _dispatcher = new Dispatcher(_commandProcessor, messageMapperRegistry, new List { connection }); diff --git a/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_has_a_new_connection_added_while_running.cs b/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_has_a_new_connection_added_while_running.cs index 067ee6cac7..50a058425d 100644 --- a/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_has_a_new_connection_added_while_running.cs +++ b/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_has_a_new_connection_added_while_running.cs @@ -50,8 +50,8 @@ public DispatcherAddNewConnectionTests() var messageMapperRegistry = new MessageMapperRegistry(new SimpleMessageMapperFactory(() => new MyEventMessageMapper())); messageMapperRegistry.Register(); - _connection = new Connection(new ConnectionName("test"), dataType: typeof(MyEvent), noOfPerformers: 1, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(_channel), channelName: new ChannelName("fakeChannel"), routingKey: "fakekey"); - _newConnection = new Connection(new ConnectionName("newTest"), dataType: typeof(MyEvent), noOfPerformers: 1, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(_channel), channelName: new ChannelName("fakeChannel"), routingKey: "fakekey"); + _connection = new Connection(new ConnectionName("test"), dataType: typeof(MyEvent), noOfPerformers: 1, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(_channel), channelName: new ChannelName("fakeChannel"), routingKey: new RoutingKey("fakekey")); + _newConnection = new Connection(new ConnectionName("newTest"), dataType: typeof(MyEvent), noOfPerformers: 1, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(_channel), channelName: new ChannelName("fakeChannel"), routingKey: new RoutingKey("fakekey")); _dispatcher = new Dispatcher(_commandProcessor, messageMapperRegistry, new List { _connection }); var @event = new MyEvent(); diff --git a/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_is_asked_to_connect_a_channel_and_handler.cs b/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_is_asked_to_connect_a_channel_and_handler.cs index 3928243921..3dd8490194 100644 --- a/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_is_asked_to_connect_a_channel_and_handler.cs +++ b/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_is_asked_to_connect_a_channel_and_handler.cs @@ -54,7 +54,7 @@ public MessageDispatcherRoutingTests() timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(_channel), channelName: new ChannelName("fakeChannel"), - routingKey: "fakekey"); + routingKey: new RoutingKey("fakekey")); _dispatcher = new Dispatcher(_commandProcessor, messageMapperRegistry, new List { connection }); var @event = new MyEvent(); diff --git a/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_restarts_a_connection.cs b/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_restarts_a_connection.cs index ca972c7840..18f051a73f 100644 --- a/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_restarts_a_connection.cs +++ b/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_restarts_a_connection.cs @@ -48,7 +48,7 @@ public MessageDispatcherResetConnection() var messageMapperRegistry = new MessageMapperRegistry(new SimpleMessageMapperFactory(() => new MyEventMessageMapper())); messageMapperRegistry.Register(); - _connection = new Connection(new ConnectionName("test"), dataType: typeof(MyEvent), noOfPerformers: 1, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(_channel), channelName: new ChannelName("fakeChannel"), routingKey: "fakekey"); + _connection = new Connection(new ConnectionName("test"), dataType: typeof(MyEvent), noOfPerformers: 1, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(_channel), channelName: new ChannelName("fakeChannel"), routingKey: new RoutingKey("fakekey")); _dispatcher = new Dispatcher(_commandProcessor, messageMapperRegistry, new List { _connection }); var @event = new MyEvent(); diff --git a/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_restarts_a_connection_after_all_connections_have_stopped.cs b/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_restarts_a_connection_after_all_connections_have_stopped.cs index 83de4523d1..9b8c246842 100644 --- a/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_restarts_a_connection_after_all_connections_have_stopped.cs +++ b/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_restarts_a_connection_after_all_connections_have_stopped.cs @@ -50,8 +50,8 @@ public DispatcherRestartConnectionTests() var messageMapperRegistry = new MessageMapperRegistry(new SimpleMessageMapperFactory(() => new MyEventMessageMapper())); messageMapperRegistry.Register(); - _connection = new Connection(new ConnectionName("test"), dataType: typeof(MyEvent), noOfPerformers: 1, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(_channel), channelName: new ChannelName("fakeChannel"), routingKey: "fakekey"); - _newConnection = new Connection(new ConnectionName("newTest"), dataType: typeof(MyEvent), noOfPerformers: 1, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(_channel), channelName: new ChannelName("fakeChannel"), routingKey: "fakekey"); + _connection = new Connection(new ConnectionName("test"), dataType: typeof(MyEvent), noOfPerformers: 1, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(_channel), channelName: new ChannelName("fakeChannel"), routingKey: new RoutingKey("fakekey")); + _newConnection = new Connection(new ConnectionName("newTest"), dataType: typeof(MyEvent), noOfPerformers: 1, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(_channel), channelName: new ChannelName("fakeChannel"), routingKey: new RoutingKey("fakekey")); _dispatcher = new Dispatcher(_commandProcessor, messageMapperRegistry, new List { _connection, _newConnection }); var @event = new MyEvent(); diff --git a/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_shuts_a_connection.cs b/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_shuts_a_connection.cs index 43b184ed32..555dbe24a1 100644 --- a/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_shuts_a_connection.cs +++ b/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_shuts_a_connection.cs @@ -46,7 +46,7 @@ public MessageDispatcherShutConnectionTests() var messageMapperRegistry = new MessageMapperRegistry(new SimpleMessageMapperFactory(() => new MyEventMessageMapper())); messageMapperRegistry.Register(); - _connection = new Connection(new ConnectionName("test"), dataType: typeof(MyEvent), noOfPerformers: 3, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(channel), channelName: new ChannelName("fakeChannel"), routingKey: "fakekey"); + _connection = new Connection(new ConnectionName("test"), dataType: typeof(MyEvent), noOfPerformers: 3, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(channel), channelName: new ChannelName("fakeChannel"), routingKey: new RoutingKey("fakekey")); _dispatcher = new Dispatcher(commandProcessor, messageMapperRegistry, new List { _connection }); var @event = new MyEvent(); diff --git a/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_starts_different_types_of_performers.cs b/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_starts_different_types_of_performers.cs index f4f22def01..876b49a409 100644 --- a/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_starts_different_types_of_performers.cs +++ b/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_starts_different_types_of_performers.cs @@ -57,8 +57,8 @@ public MessageDispatcherMultipleConnectionTests() messageMapperRegistry.Register(); - var myEventConnection = new Connection(new ConnectionName("test"), dataType: typeof(MyEvent), noOfPerformers: 1, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(_eventChannel), channelName: new ChannelName("fakeChannel"), routingKey: "fakekey"); - var myCommandConnection = new Connection(new ConnectionName("anothertest"), dataType: typeof(MyCommand), noOfPerformers: 1, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(_commandChannel), channelName: new ChannelName("fakeChannel"), routingKey: "fakekey"); + var myEventConnection = new Connection(new ConnectionName("test"), dataType: typeof(MyEvent), noOfPerformers: 1, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(_eventChannel), channelName: new ChannelName("fakeChannel"), routingKey: new RoutingKey("fakekey")); + var myCommandConnection = new Connection(new ConnectionName("anothertest"), dataType: typeof(MyCommand), noOfPerformers: 1, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(_commandChannel), channelName: new ChannelName("fakeChannel"), routingKey: new RoutingKey("fakekey")); _dispatcher = new Dispatcher(commandProcessor, messageMapperRegistry, new List { myEventConnection, myCommandConnection }); var @event = new MyEvent(); diff --git a/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_starts_multiple_performers.cs b/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_starts_multiple_performers.cs index 2375cafac1..2f9d907fa2 100644 --- a/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_starts_multiple_performers.cs +++ b/tests/Paramore.Brighter.Tests/MessageDispatch/When_a_message_dispatcher_starts_multiple_performers.cs @@ -48,7 +48,7 @@ public MessageDispatcherMultiplePerformerTests() var messageMapperRegistry = new MessageMapperRegistry(new SimpleMessageMapperFactory(() => new MyEventMessageMapper())); messageMapperRegistry.Register(); - var connection = new Connection(new ConnectionName("test"), dataType: typeof(MyEvent), noOfPerformers: 3, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(_channel), channelName: new ChannelName("fakeChannel"), routingKey: "fakekey"); + var connection = new Connection(new ConnectionName("test"), dataType: typeof(MyEvent), noOfPerformers: 3, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(_channel), channelName: new ChannelName("fakeChannel"), routingKey: new RoutingKey("fakekey")); _dispatcher = new Dispatcher(_commandProcessor, messageMapperRegistry, new List { connection }); var @event = new MyEvent(); diff --git a/tests/Paramore.Brighter.Tests/MessageDispatch/When_building_a_dispatcher.cs b/tests/Paramore.Brighter.Tests/MessageDispatch/When_building_a_dispatcher.cs index d6c073e801..f93d6803a2 100644 --- a/tests/Paramore.Brighter.Tests/MessageDispatch/When_building_a_dispatcher.cs +++ b/tests/Paramore.Brighter.Tests/MessageDispatch/When_building_a_dispatcher.cs @@ -76,14 +76,14 @@ public DispatchBuilderTests() new InputChannelFactory(rmqMessageConsumerFactory, rmqMessageProducerFactory), typeof(MyEvent), new ChannelName("mary"), - "bob", + new RoutingKey("bob"), timeoutInMilliseconds: 200), new Connection( new ConnectionName("bar"), new InputChannelFactory(rmqMessageConsumerFactory, rmqMessageProducerFactory), typeof(MyEvent), new ChannelName("alice"), - "simon", + new RoutingKey("simon"), timeoutInMilliseconds: 200) }; diff --git a/tests/Paramore.Brighter.Tests/MessageDispatch/When_building_a_dispatcher_with_named_gateway.cs b/tests/Paramore.Brighter.Tests/MessageDispatch/When_building_a_dispatcher_with_named_gateway.cs index 36e9b2d1d4..1b675ee4bd 100644 --- a/tests/Paramore.Brighter.Tests/MessageDispatch/When_building_a_dispatcher_with_named_gateway.cs +++ b/tests/Paramore.Brighter.Tests/MessageDispatch/When_building_a_dispatcher_with_named_gateway.cs @@ -75,14 +75,14 @@ public DispatchBuilderWithNamedGateway() new InputChannelFactory(rmqMessageConsumerFactory, rmqMessageProducerFactory), typeof(MyEvent), new ChannelName("mary"), - "bob", + new RoutingKey("bob"), timeoutInMilliseconds: 200), new Connection( new ConnectionName("bar"), new InputChannelFactory(rmqMessageConsumerFactory, rmqMessageProducerFactory), typeof(MyEvent), new ChannelName("alice"), - "simon", + new RoutingKey("simon"), timeoutInMilliseconds: 200) };