public void WeShouldGetTheRightMethod() { var request = new SomeInternalMulticastRequest(); var handlerMethod = MulticastRequestMessageDispatcher.GetGenericDispatchMethodFor(request); handlerMethod.ShouldNotBe(null); }
public IEnumerable<IMessagePump> CreateAll() { _logger.Debug("Creating multicast request message pumps"); var requestTypes = _requestHandlerTypes.Value.SelectMany(ht => ht.GetGenericInterfacesClosing(typeof (IHandleRequest<,>))) .Select(gi => gi.GetGenericArguments().First()) .OrderBy(t => t.FullName) .Distinct() .ToArray(); foreach (var requestType in requestTypes) { _logger.Debug("Creating message pump for multicase request type {0}", requestType.Name); var topicPath = PathFactory.TopicPathFor(requestType); var applicationSharedSubscriptionName = String.Format("{0}", _applicationName); var messageReceiver = new NimbusSubscriptionMessageReceiver(_queueManager, topicPath, applicationSharedSubscriptionName, _concurrentHandlerLimit); _garbageMan.Add(messageReceiver); var dispatcher = new MulticastRequestMessageDispatcher(_messagingFactory, _multicastRequestHandlerFactory, requestType, _clock); _garbageMan.Add(dispatcher); var pump = new MessagePump(messageReceiver, dispatcher, _logger, _clock); _garbageMan.Add(pump); yield return pump; } }