protected virtual void HandleActionRequest(Message <ComposerActionRequest> requestMessage) { try { if (requestMessage.Data.Count > 1) { // this method assumes that only one report is contained per message, so die here - something's gotten messed up throw new InvalidOperationException( "More than the expected message count was received. This indicates a bug in the program."); } var request = requestMessage.Data.First(); if (_dynamicallyKeyedWorkerConfigurations.ContainsKey(request.SourceQueueIdentifier)) { // Already got this handled, can just exit out return; } // Right now the only kind of request we can make is that a new solo listener is attached to a queue // We can extend this functionality in the future if necessary var listenerConfiguration = new PocoListenerConfiguration { ActorType = request.ListenerType, PollingInterval = 10, QueueReadInterval = 10, QueueReadMessageCountThreshold = 1, ReportQueue = GetListenerReportQueueName(), SourceQueue = request.SourceQueueIdentifier }; var workerConfiguration = new PocoKeyedWorkerConfiguration { ActorType = request.WorkerType, NextQueue = request.WorkerNextQueueIdentifier, ReportQueue = GetWorkerReportQueueName(), SourceQueue = request.SourceQueueIdentifier, KeyType = request.KeyType, Key = request.Key }; _dynamicallyKeyedWorkerConfigurations.Add(request.SourceQueueIdentifier, workerConfiguration); _actorManager.CreateAndStartKeyedSoloListener(listenerConfiguration, _dependencyResolver, request.Key, request.KeyType); _listenerConfigurations.Add(listenerConfiguration); } catch (Exception ex) { OnErrorAction(ex); } }