示例#1
0
        internal MessagePublisher(IMessagingEntityFactory messagingEntityFactory, IMessageSerializer serializer, IMessagePropertyProvider <TMessage> propertyProvider, IMessageOutgoingPropertiesTable messageOutgoingPropertiesTable)
        {
            if (messagingEntityFactory == null)
            {
                throw new ArgumentNullException(nameof(messagingEntityFactory));
            }
            if (serializer == null)
            {
                throw new ArgumentNullException(nameof(serializer));
            }
            if (propertyProvider == null)
            {
                throw new ArgumentNullException(nameof(propertyProvider));
            }
            if (messageOutgoingPropertiesTable == null)
            {
                throw new ArgumentNullException(nameof(messageOutgoingPropertiesTable));
            }

            _messagingEntityFactory         = messagingEntityFactory;
            _serializer                     = serializer;
            _propertyProvider               = propertyProvider;
            _messageOutgoingPropertiesTable = messageOutgoingPropertiesTable;

            _messageTypeMessageSenderMap = new ConcurrentDictionary <Type, IMessageSender>();
        }
        public AzureServiceBusEndpointProvider(string serviceName, IMessagingFactory messagingFactory, IMessageSerializer messageSerializer, IMessageDeserializerFactory messageDeserializerFactory, List <MessageTypeMessagingEntityMappingDetails> messageTypePathMappings, Func <Assembly, bool> assemblyFilter, Func <Type, bool> typeFilter, MessagePropertyProviderManager <TMessage> messagePropertyProviderManager, IMessageOutgoingPropertiesTable messageOutgoingPropertiesTable)
            : base(serviceName)
        {
            if (messagingFactory == null)
            {
                throw new ArgumentNullException(nameof(messagingFactory));
            }
            if (messageSerializer == null)
            {
                throw new ArgumentNullException(nameof(messageSerializer));
            }
            if (messageDeserializerFactory == null)
            {
                throw new ArgumentNullException(nameof(messageDeserializerFactory));
            }
            if (messageTypePathMappings == null)
            {
                throw new ArgumentNullException(nameof(messageTypePathMappings));
            }
            if (messageTypePathMappings.Count == 0)
            {
                throw new ArgumentException("An empty set of path mappings was specified.", nameof(messageTypePathMappings));
            }
            if (messagePropertyProviderManager == null)
            {
                throw new ArgumentNullException(nameof(messagePropertyProviderManager));
            }
            if (messageOutgoingPropertiesTable == null)
            {
                throw new ArgumentNullException(nameof(messageOutgoingPropertiesTable));
            }

            _messageSerializer          = messageSerializer;
            _messageDeserializerFactory = messageDeserializerFactory;
            _assemblyFilter             = assemblyFilter;
            _typeFilter = typeFilter;
            _messageTypePathMappings        = messageTypePathMappings;
            _messagePropertyProviderManager = messagePropertyProviderManager;
            _messageOutgoingPropertiesTable = messageOutgoingPropertiesTable;

            _messagingEntityFactory = new MessagingEntityFactory(messagingFactory, messageTypePathMappings);
        }
 public DefaultMessagePropertiesProvider(IMessageBrokeredMessageTable messageBrokeredMessageTable, IMessageOutgoingPropertiesTable messageOutgoingPropertiesTable)
 {
     _messageBrokeredMessageTable    = messageBrokeredMessageTable;
     _messageOutgoingPropertiesTable = messageOutgoingPropertiesTable;
 }