Beispiel #1
0
 private static void RegisterDomainEventSubscriptionMappings(DomainEventBusConfig domainEventBusConfig, IEnumerable<Type> domainEventTypes, ICollection<Type> domainEventMessageTypes, UnicastBus bus)
 {
     var domainEventMessageType = typeof(DomainEventMessage<>);
     foreach (DomainEventEndpointMapping mapping in domainEventBusConfig.DomainEventEndpointMappings)
     {
         foreach (var domainEventType in domainEventTypes)
         {
             if (DomainEventsIsDomainEvent(domainEventType, mapping.DomainEvents))
             {
                 var messageType = domainEventMessageType.MakeGenericType(domainEventType);
                 domainEventMessageTypes.Add(messageType);
                 bus.RegisterMessageType(messageType, new Address(mapping.QueueName, mapping.MachineName));
             }
         }
     }
 }
Beispiel #2
0
 private static void RegisterAssemblyDomainEventSubscriptionMappings(DomainEventBusConfig domainEventBusConfig, IEnumerable<Type> domainEventTypes, ICollection<Type> domainEventMessageTypes, UnicastBus bus)
 {
     var domainEventMessageType = typeof(DomainEventMessage<>);
     foreach(DomainEventEndpointMapping mapping in domainEventBusConfig.DomainEventEndpointMappings)
     {
         foreach(var domainEventType in domainEventTypes)
         {
             if (DomainEventsIsAssembly(domainEventType, mapping.DomainEvents))
             {
                 var messageType = domainEventMessageType.MakeGenericType(domainEventType);
                 domainEventMessageTypes.Add(messageType);
                 bus.RegisterMessageType(messageType, mapping.Endpoint, false);
             }
         }
     }
 }
Beispiel #3
0
        private static void RegisterAssemblyDomainEventSubscriptionMappings(DomainEventBusConfig domainEventBusConfig, IEnumerable <Type> domainEventTypes, ICollection <Type> domainEventMessageTypes, UnicastBus bus)
        {
            var domainEventMessageType = typeof(DomainEventMessage <>);

            foreach (DomainEventEndpointMapping mapping in domainEventBusConfig.DomainEventEndpointMappings)
            {
                foreach (var domainEventType in domainEventTypes)
                {
                    if (DomainEventsIsAssembly(domainEventType, mapping.DomainEvents))
                    {
                        var messageType = domainEventMessageType.MakeGenericType(domainEventType);
                        domainEventMessageTypes.Add(messageType);
                        bus.RegisterMessageType(messageType, new Address(mapping.QueueName, mapping.MachineName));
                    }
                }
            }
        }
        private static void RegisterDomainEventSubscriptionMappings(DomainEventBusConfig domainEventBusConfig, IEnumerable <Type> domainEventTypes, ICollection <Type> domainEventMessageTypes, UnicastBus bus)
        {
            var domainEventMessageType = typeof(DomainEventMessage <>);

            foreach (DomainEventEndpointMapping mapping in domainEventBusConfig.DomainEventEndpointMappings)
            {
                foreach (var domainEventType in domainEventTypes)
                {
                    if (DomainEventsIsDomainEvent(domainEventType, mapping.DomainEvents))
                    {
                        var messageType = domainEventMessageType.MakeGenericType(domainEventType);
                        domainEventMessageTypes.Add(messageType);
                        bus.RegisterMessageType(messageType, mapping.Endpoint, false);
                    }
                }
            }
        }
Beispiel #5
0
 protected void RegisterMessageType <T>(Address address)
 {
     MessageMapper.Initialize(new[] { typeof(T) });
     MessageSerializer.Initialize(new[] { typeof(T) });
     unicastBus.RegisterMessageType(typeof(T), address);
 }