/// <summary> /// Initializes a new instance of the <see cref="SqlHeaders"/> class. /// </summary> /// <param name="messageContextDataFactory">The message context data factory.</param> public SqlHeaders(IMessageContextDataFactory messageContextDataFactory) { Guard.NotNull(() => messageContextDataFactory, messageContextDataFactory); Connection = messageContextDataFactory.Create<Connection>("Connection", null); IncreaseQueueDelay = messageContextDataFactory.Create("IncreaseQueueDelay", new SqlQueueDelay(TimeSpan.Zero)); }
/// <summary> /// Initializes a new instance of the <see cref="StandardHeaders"/> class. /// </summary> /// <param name="messageContextDataFactory">The message context data factory.</param> public StandardHeaders(IMessageContextDataFactory messageContextDataFactory) { Guard.NotNull(() => messageContextDataFactory, messageContextDataFactory); FirstPossibleDeliveryDate = messageContextDataFactory.Create <ValueTypeWrapper <DateTime> >("Queue-FirstPossibleDeliveryDate", null); MessageInterceptorGraph = messageContextDataFactory.Create("Queue-MessageInterceptorGraph", new MessageInterceptorsGraph()); }
/// <summary> /// Initializes a new instance of the <see cref="RedisHeaders" /> class. /// </summary> /// <param name="messageContextDataFactory">The message context data factory.</param> /// <param name="headers">The headers.</param> public RedisHeaders(IMessageContextDataFactory messageContextDataFactory, IHeaders headers) { Guard.NotNull(() => messageContextDataFactory, messageContextDataFactory); Guard.NotNull(() => headers, headers); Headers = headers; IncreaseQueueDelay = messageContextDataFactory.Create("IncreaseQueueDelay", new RedisQueueDelay(TimeSpan.Zero)); CorrelationId = messageContextDataFactory.Create <RedisQueueCorrelationIdSerialized>("CorrelationId", null); }
/// <summary> /// Initializes a new instance of the <see cref="RedisHeaders" /> class. /// </summary> /// <param name="messageContextDataFactory">The message context data factory.</param> /// <param name="headers">The headers.</param> public RedisHeaders(IMessageContextDataFactory messageContextDataFactory, IHeaders headers) { Guard.NotNull(() => messageContextDataFactory, messageContextDataFactory); Guard.NotNull(() => headers, headers); Headers = headers; IncreaseQueueDelay = messageContextDataFactory.Create("IncreaseQueueDelay", new RedisQueueDelay(TimeSpan.Zero)); CorelationId = messageContextDataFactory.Create<RedisQueueCorrelationIdSerialized>("CorelationId", null); }
/// <summary> /// Adds the specified header accessor to the collection /// </summary> /// <typeparam name="T">The type of the header data.</typeparam> /// <param name="name">The name.</param> /// <param name="defaultValue">The default value.</param> /// <returns></returns> public IMessageContextData <T> Add <T>(string name, T defaultValue) where T : class { if (!_headers.ContainsKey(name)) { _headers[name] = _messageContextDataFactory.Create(name, defaultValue); } return((IMessageContextData <T>)_headers[name]); }
/// <summary> /// Initializes a new instance of the <see cref="StandardHeaders"/> class. /// </summary> /// <param name="messageContextDataFactory">The message context data factory.</param> /// <param name="timeoutFactory">The timeout factory.</param> public StandardHeaders(IMessageContextDataFactory messageContextDataFactory, IRpcTimeoutFactory timeoutFactory) { Guard.NotNull(() => messageContextDataFactory, messageContextDataFactory); Guard.NotNull(() => timeoutFactory, timeoutFactory); RpcTimeout = messageContextDataFactory.Create("Queue-RPCTimeout", timeoutFactory.Create(TimeSpan.Zero)); RpcResponseId = messageContextDataFactory.Create <string>("Queue-RPCResponseID", null); RpcConsumerException = messageContextDataFactory.Create <Exception>("Queue-RPCConsumerException", null); RpcConnectionInfo = messageContextDataFactory.Create <IConnectionInformation>("Queue-RPCConnectionInfo", null); RpcContext = messageContextDataFactory.Create <IRpcContext>("Queue-RPCContext", null); FirstPossibleDeliveryDate = messageContextDataFactory.Create <ValueTypeWrapper <DateTime> >("Queue-FirstPossibleDeliveryDate", null); MessageInterceptorGraph = messageContextDataFactory.Create("Queue-MessageInterceptorGraph", new MessageInterceptorsGraph()); }
/// <summary> /// Initializes a new instance of the <see cref="StandardHeaders"/> class. /// </summary> /// <param name="messageContextDataFactory">The message context data factory.</param> /// <param name="timeoutFactory">The timeout factory.</param> public StandardHeaders(IMessageContextDataFactory messageContextDataFactory, IRpcTimeoutFactory timeoutFactory) { Guard.NotNull(() => messageContextDataFactory, messageContextDataFactory); Guard.NotNull(() => timeoutFactory, timeoutFactory); RpcTimeout = messageContextDataFactory.Create("Queue-RPCTimeout", timeoutFactory.Create(TimeSpan.Zero)); RpcResponseId = messageContextDataFactory.Create<string>("Queue-RPCResponseID", null); RpcConsumerException = messageContextDataFactory.Create<Exception>("Queue-RPCConsumerException", null); RpcConnectionInfo = messageContextDataFactory.Create<IConnectionInformation>("Queue-RPCConnectionInfo", null); RpcContext = messageContextDataFactory.Create<IRpcContext>("Queue-RPCContext", null); FirstPossibleDeliveryDate = messageContextDataFactory.Create<ValueTypeWrapper<DateTime>>("Queue-FirstPossibleDeliveryDate", null); MessageInterceptorGraph = messageContextDataFactory.Create("Queue-MessageInterceptorGraph", new MessageInterceptorsGraph()); }
/// <summary> /// Initializes a new instance of the <see cref="QueueDelay"/> class. /// </summary> /// <param name="messageContextDataFactory">The message context data factory.</param> public IncreaseQueueDelay(IMessageContextDataFactory messageContextDataFactory) { Guard.NotNull(() => messageContextDataFactory, messageContextDataFactory); QueueDelay = messageContextDataFactory.Create("IncreaseQueueDelay", new QueueDelay(TimeSpan.Zero)); }
/// <summary> /// Initializes a new instance of the <see cref="ConnectionHeader{TConnection, TTransaction, TCommand}"/> class. /// </summary> /// <param name="messageContextDataFactory">The message context data factory.</param> public ConnectionHeader(IMessageContextDataFactory messageContextDataFactory) { Guard.NotNull(() => messageContextDataFactory, messageContextDataFactory); Connection = messageContextDataFactory.Create <IConnectionHolder <TConnection, TTransaction, TCommand> >("Connection", null); }