Пример #1
0
 void ConfigurePublish(IConfigurationModel configurationModel, IAutoConfigurationModel autoConfigurationModel, Type type)
 {
     foreach (IPublishConfigurationConvention convention in autoConfigurationModel.PublishConfigurationConventions)
     {
         if (convention.ShouldRegister(type))
         {
             PublishInfo publishInfo = GetPublishInfo(type, convention);
             configurationModel.PublishRouteConfiguration.AddPolicy <MappingRouteInfoLookupStrategy <IPublishInfo> >(type, publishInfo);
         }
     }
 }
Пример #2
0
		static PublishInfo GetPublishInfo(Type type, IPublishConfigurationConvention convention)
		{
			var publishInfo = new PublishInfo
			                  	{
			                  		ExchangeName = convention.GetExchangeName(type),
			                  		IsAutoDelete = convention.IsAutoDeleteExchange(type),
			                  		IsDurable = convention.IsDurableExchange(type),
			                  		IsPersistent = convention.IsPersistent(type),
			                  		ExchangeType = convention.GetExchangeType(type),
			                  		DefaultRoutingKey = convention.GetDefaultRouteKey(type),
			                  		IsSigned = convention.IsSigned(type)
			                  	};

			ISerializationStrategy serializationStrategy = convention.GetSerializationStrategy(type);
			if (serializationStrategy != null)
			{
				publishInfo.SerializationStrategy = serializationStrategy;
			}
			return publishInfo;
		}
Пример #3
0
        static PublishInfo GetPublishInfo(Type type, IPublishConfigurationConvention convention)
        {
            var publishInfo = new PublishInfo
            {
                ExchangeName      = convention.GetExchangeName(type),
                IsAutoDelete      = convention.IsAutoDeleteExchange(type),
                IsDurable         = convention.IsDurableExchange(type),
                IsPersistent      = convention.IsPersistent(type),
                ExchangeType      = convention.GetExchangeType(type),
                DefaultRoutingKey = convention.GetDefaultRouteKey(type),
                IsSigned          = convention.IsSigned(type)
            };

            ISerializationStrategy serializationStrategy = convention.GetSerializationStrategy(type);

            if (serializationStrategy != null)
            {
                publishInfo.SerializationStrategy = serializationStrategy;
            }
            return(publishInfo);
        }
Пример #4
0
 public PublishConfigurationContext(string defaultName)
 {
     PublishInfo = new PublishInfo();
     PublishInfo.ExchangeName = defaultName;
 }
		public PublishConfigurationContext(string defaultName)
		{
			PublishInfo = new PublishInfo();
			PublishInfo.ExchangeName = defaultName;
		}