/// <summary> /// Initializes a new instance of the <see cref="Connection"/> class. /// </summary> /// <param name="dataType">Type of the data.</param> /// <param name="name">The name. Defaults to the data type's full name.</param> /// <param name="channelName">The channel name. Defaults to the data type's full name.</param> /// <param name="routingKey">The routing key. Defaults to the data type's full name.</param> /// <param name="noOfPerformers">The no of performers.</param> /// <param name="timeoutInMilliseconds">The timeout in milliseconds.</param> /// <param name="requeueCount">The number of times you want to requeue a message before dropping it.</param> /// <param name="requeueDelayInMilliseconds">The number of milliseconds to delay the delivery of a requeue message for.</param> /// <param name="unacceptableMessageLimit">The number of unacceptable messages to handle, before stopping reading from the channel.</param> /// <param name="isDurable">The durability of the queue.</param> /// <param name="channelFactory">The channel factory to create channels for Consumer.</param> public Connection( Type dataType, ConnectionName name = null, ChannelName channelName = null, RoutingKey routingKey = null, int noOfPerformers = 1, int timeoutInMilliseconds = 300, int requeueCount = -1, int requeueDelayInMilliseconds = 0, int unacceptableMessageLimit = 0, bool isDurable = false, bool isAsync = false, IAmAChannelFactory channelFactory = null) { DataType = dataType; Name = name ?? new ConnectionName(dataType.FullName); ChannelName = channelName ?? new ChannelName(dataType.FullName); RoutingKey = routingKey ?? new RoutingKey(dataType.FullName); NoOfPeformers = noOfPerformers; TimeoutInMiliseconds = timeoutInMilliseconds; RequeueCount = requeueCount; RequeueDelayInMilliseconds = requeueDelayInMilliseconds; UnacceptableMessageLimit = unacceptableMessageLimit; IsDurable = isDurable; IsAsync = isAsync; ChannelFactory = channelFactory; }
/// <summary> /// Initializes a new instance of the <see cref="Consumer"/> class. /// </summary> /// <param name="name">The name.</param> /// <param name="connectionName">The name of the associated connection.</param> /// <param name="channel">The channel.</param> /// <param name="messagePump">The message pump.</param> public Consumer(ConsumerName name, ConnectionName connectionName, IAmAChannel channel, IAmAMessagePump messagePump) { Name = name; ConnectionName = connectionName; Performer = new Performer(channel, messagePump); State = ConsumerState.Shut; }
/// <summary> /// Initializes a new instance of the <see cref="Connection"/> class. /// </summary> /// <param name="name">The name.</param> /// <param name="channelFactory">The channel factory to create channels for Consumer</param> /// <param name="dataType">Type of the data.</param> /// <param name="routingKey">The routing key</param> /// <param name="noOfPerformers">The no of performers.</param> /// <param name="timeoutInMilliseconds">The timeout in milliseconds.</param> /// <param name="requeueCount">The number of times you want to requeue a message before dropping it</param> /// <param name="requeueDelayInMilliseconds">The number of milliseconds to delay the delivery of a requeue message for</param> /// <param name="unacceptableMessageLimit">The number of unacceptable messages to handle, before stopping reading from the channel</param> /// <param name="channelName">The channel name</param> /// <param name="isDurable">The durability of the queue</param> public Connection(ConnectionName name, IAmAChannelFactory channelFactory, Type dataType, ChannelName channelName, string routingKey, int noOfPerformers = 1, int timeoutInMilliseconds = 300, int requeueCount = -1, int requeueDelayInMilliseconds = 0, int unacceptableMessageLimit = 0, bool isDurable = false, bool isAsync = false) { RequeueCount = requeueCount; Name = name; ChannelFactory = channelFactory; DataType = dataType; NoOfPeformers = noOfPerformers; TimeoutInMiliseconds = timeoutInMilliseconds; UnacceptableMessageLimit = unacceptableMessageLimit; RequeueDelayInMilliseconds = requeueDelayInMilliseconds; ChannelName = channelName; RoutingKey = routingKey; IsDurable = isDurable; IsAsync = isAsync; }
public Connection(ConnectionName name, IAmAChannelFactory channelFactory, Type dataType, ChannelName channelName, RoutingKey routingKey, int noOfPerformers = 1, int timeoutInMilliseconds = 300, int requeueCount = -1, int requeueDelayInMilliseconds = 0, int unacceptableMessageLimit = 0, bool isDurable = false, bool isAsync = false) : this(dataType, name, channelName, routingKey, noOfPerformers, timeoutInMilliseconds, requeueCount, requeueDelayInMilliseconds, unacceptableMessageLimit, isDurable, isAsync, channelFactory) { }