Ejemplo n.º 1
0
        private MessageRegistration GetMessageRegistrationFor(TransportLevelMessage message)
        {
            var messageId    = message.Metadata.MessageId;
            var messageType  = message.Metadata.Type;
            var registration = _messageHandlerRegistry.GetRegistrationFor(messageType);

            if (registration == null)
            {
                throw new MissingMessageHandlerRegistrationException($"Error! A handler has not been registered for messages of type \"{messageType}\". Message with id \"{messageId}\" was not handled.");
            }

            return(registration);
        }
Ejemplo n.º 2
0
 private MessageRegistration GetMessageRegistrationFor(TransportLevelMessage message) =>
 _messageHandlerRegistry.GetRegistrationFor(message.Metadata.Type)
 ?? _fallbackHandler.GetFallback(message.Metadata.Type);