/// <summary> /// Maps a specific message type to a set of topics. The transport will automatically map the most concrete type to a topic. /// In case a subscriber needs to subscribe to a type up in the message inheritance chain a custom mapping needs to be defined. /// </summary> public static void MapEvent(this TransportExtensions <SqsTransport> transportExtensions, Type subscribedEventType, IEnumerable <string> customTopicsNames) { Guard.AgainstNull(nameof(customTopicsNames), customTopicsNames); var settings = transportExtensions.GetSettings(); if (!settings.TryGet <EventToTopicsMappings>(out var mappings)) { mappings = new EventToTopicsMappings(); settings.Set(mappings); } mappings.Add(subscribedEventType, customTopicsNames); }
public void SetUp() { sqsClient = new MockSqsClient(); snsClient = new MockSnsClient(); sqsClient.EnableGetAttributeReturnsWhatWasSet(); settings = new SettingsHolder(); customEventToTopicsMappings = new EventToTopicsMappings(); settings.Set(customEventToTopicsMappings); customEventToEventsMappings = new EventToEventsMappings(); settings.Set(customEventToEventsMappings); messageMetadataRegistry = settings.SetupMessageMetadataRegistry(); queueName = "fakeQueue"; manager = CreateNonBatchingSubscriptionManager(); }