Example #1
0
 public PullRequest(string consumerId, string groupName, MessageQueue messageQueue, long nextConsumeOffset)
 {
     ConsumerId        = consumerId;
     GroupName         = groupName;
     MessageQueue      = messageQueue;
     NextConsumeOffset = nextConsumeOffset;
     ProcessQueue      = new ProcessQueue();
 }
Example #2
0
 public PullRequest(string consumerId, string groupName, MessageQueue messageQueue, long nextConsumeOffset)
 {
     ConsumerId = consumerId;
     GroupName = groupName;
     MessageQueue = messageQueue;
     NextConsumeOffset = nextConsumeOffset;
     ProcessQueue = new ProcessQueue();
 }
Example #3
0
 public PullRequest(string consumerId, string groupName, MessageQueue messageQueue, long nextConsumeOffset, HashSet<string> tags)
 {
     ConsumerId = consumerId;
     GroupName = groupName;
     MessageQueue = messageQueue;
     NextConsumeOffset = nextConsumeOffset;
     ProcessQueue = new ProcessQueue();
     Tags = tags ?? new HashSet<string>();
 }
Example #4
0
 public PullRequest(string consumerId, string groupName, MessageQueue messageQueue, long nextConsumeOffset, HashSet <string> tags)
 {
     ConsumerId        = consumerId;
     GroupName         = groupName;
     MessageQueue      = messageQueue;
     NextConsumeOffset = nextConsumeOffset;
     ProcessQueue      = new ProcessQueue();
     Tags = tags ?? new HashSet <string>();
 }
Example #5
0
        public PullRequest(
            string consumerId,
            string groupName,
            MessageQueue messageQueue,
            SocketRemotingClient remotingClient,
            MessageHandleMode messageHandleMode,
            IMessageHandler messageHandler,
            IOffsetStore offsetStore,
            PullRequestSetting setting)
        {
            ConsumerId = consumerId;
            GroupName = groupName;
            MessageQueue = messageQueue;
            ProcessQueue = new ProcessQueue();

            _queueOffset = -1;
            _remotingClient = remotingClient;
            _setting = setting;
            _messageHandleMode = messageHandleMode;
            _messageHandler = messageHandler;
            _offsetStore = offsetStore;
            _messageQueue = new BlockingCollection<WrappedMessage>(new ConcurrentQueue<WrappedMessage>());
            _handlingMessageDict = new ConcurrentDictionary<long, WrappedMessage>();
            _pullMessageWorker = new Worker(() =>
            {
                try
                {
                    PullMessage();
                }
                catch (Exception ex)
                {
                    if (!_stoped)
                    {
                        _logger.Error(string.Format("[{0}]: PullMessage has unknown exception. PullRequest: {1}.", ConsumerId, this), ex);
                    }
                }
            });
            _handleMessageWorker = new Worker(HandleMessage);
            _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>();
            _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().Name);
        }
Example #6
0
        public PullRequest(
            string consumerId,
            string groupName,
            MessageQueue messageQueue,
            long queueOffset,
            SocketRemotingClient remotingClient,
            MessageHandleMode messageHandleMode,
            IMessageHandler messageHandler,
            PullRequestSetting setting)
        {
            ConsumerId   = consumerId;
            GroupName    = groupName;
            MessageQueue = messageQueue;
            ProcessQueue = new ProcessQueue();

            _queueOffset         = queueOffset;
            _remotingClient      = remotingClient;
            _setting             = setting;
            _messageHandleMode   = messageHandleMode;
            _messageHandler      = messageHandler;
            _messageQueue        = new BlockingCollection <WrappedMessage>(new ConcurrentQueue <WrappedMessage>());
            _handlingMessageDict = new ConcurrentDictionary <long, WrappedMessage>();
            _pullMessageWorker   = new Worker(() =>
            {
                try
                {
                    PullMessage();
                }
                catch (Exception ex)
                {
                    if (!_stoped)
                    {
                        _logger.Error(string.Format("PullMessage has unknown exception, pullRequest:{0}.", this), ex);
                    }
                }
            });
            _handleMessageWorker = new Worker(HandleMessage);
            _binarySerializer    = ObjectContainer.Resolve <IBinarySerializer>();
            _logger = ObjectContainer.Resolve <ILoggerFactory>().Create(GetType().FullName);
        }
Example #7
0
 public ConsumingMessage(QueueMessage message, ProcessQueue processQueue)
 {
     Message      = message;
     ProcessQueue = processQueue;
 }
Example #8
0
 public WrappedMessage(MessageQueue messageQueue, QueueMessage queueMessage, ProcessQueue processQueue)
 {
     MessageQueue = messageQueue;
     QueueMessage = queueMessage;
     ProcessQueue = processQueue;
 }
Example #9
0
 public WrappedMessage(MessageQueue messageQueue, QueueMessage queueMessage, ProcessQueue processQueue)
 {
     MessageQueue = messageQueue;
     QueueMessage = queueMessage;
     ProcessQueue = processQueue;
 }
Example #10
0
 public ConsumingMessage(QueueMessage message, ProcessQueue processQueue)
 {
     Message = message;
     ProcessQueue = processQueue;
 }