示例#1
0
        protected virtual Boolean Equals(ProducerId that)
        {
            if (!Equals(ConnectionId, that.ConnectionId))
            {
                return(false);
            }

            return(Equals(Value, that.Value) && Equals(SessionId, that.SessionId));
        }
示例#2
0
        /// <summary>
        ///     Sets the value as a String
        /// </summary>
        private void SetValue(String messageKey)
        {
            var mkey = messageKey;

            _key = mkey;

            // Parse off the sequenceId
            var p = mkey.LastIndexOf(":", StringComparison.Ordinal);

            if (p >= 0)
            {
                if (Int64.TryParse(mkey.Substring(p + 1), out _producerSequenceId))
                {
                    mkey = mkey.Substring(0, p);
                }
                else
                {
                    _producerSequenceId = 0;
                }
            }

            ProducerId = new ProducerId(mkey);
        }
示例#3
0
        public MessageId(String value)
        {
            var mkey = value;

            _key = mkey;

            // Parse off the sequenceId
            var p = mkey.LastIndexOf(":", StringComparison.Ordinal);

            if (p >= 0)
            {
                if (Int64.TryParse(mkey.Substring(p + 1), out var producerSequenceId))
                {
                    ProducerSequenceId = producerSequenceId;
                    mkey = mkey.Substring(0, p);
                }
                else
                {
                    ProducerSequenceId = 0;
                }
            }

            ProducerId = new ProducerId(mkey);
        }
示例#4
0
 public MessageId(ProducerId prodId, Int64 producerSeqId)
 {
     ProducerId         = prodId;
     ProducerSequenceId = producerSeqId;
 }
示例#5
0
 public ConnectionId(ProducerId producerId)
 {
     Value = producerId.ConnectionId;
 }
示例#6
0
 public SessionId(ProducerId producerId)
 {
     ConnectionId = producerId.ConnectionId;
     Value        = producerId.SessionId;
 }