Ejemplo n.º 1
0
 public PullRequest(string consumerId, string groupName, MessageQueue messageQueue, long nextConsumeOffset)
 {
     ConsumerId        = consumerId;
     GroupName         = groupName;
     MessageQueue      = messageQueue;
     NextConsumeOffset = nextConsumeOffset;
     ProcessQueue      = new ProcessQueue();
 }
Ejemplo n.º 2
0
 public PullRequest(string consumerId, string groupName, MessageQueue messageQueue, long nextConsumeOffset)
 {
     ConsumerId = consumerId;
     GroupName = groupName;
     MessageQueue = messageQueue;
     NextConsumeOffset = nextConsumeOffset;
     ProcessQueue = new ProcessQueue();
 }
Ejemplo n.º 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>();
 }
Ejemplo n.º 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>();
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 7
0
 public ConsumingMessage(QueueMessage message, ProcessQueue processQueue)
 {
     Message      = message;
     ProcessQueue = processQueue;
 }
Ejemplo n.º 8
0
 public WrappedMessage(MessageQueue messageQueue, QueueMessage queueMessage, ProcessQueue processQueue)
 {
     MessageQueue = messageQueue;
     QueueMessage = queueMessage;
     ProcessQueue = processQueue;
 }
Ejemplo n.º 9
0
 public WrappedMessage(MessageQueue messageQueue, QueueMessage queueMessage, ProcessQueue processQueue)
 {
     MessageQueue = messageQueue;
     QueueMessage = queueMessage;
     ProcessQueue = processQueue;
 }
Ejemplo n.º 10
0
 public ConsumingMessage(QueueMessage message, ProcessQueue processQueue)
 {
     Message = message;
     ProcessQueue = processQueue;
 }