Esempio n. 1
0
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }

            if (obj == null)
            {
                return(false);
            }

            if (GetType() != obj.GetType())
            {
                return(false);
            }

            var other = (Message)obj;

            if (!ObjectUtils.NullSafeEquals(Body, other.Body))
            {
                return(false);
            }

            if (MessageProperties == null)
            {
                if (other.MessageProperties != null)
                {
                    return(false);
                }
            }
            else if (!MessageProperties.Equals(other.MessageProperties))
            {
                return(false);
            }

            return(true);
        }
Esempio n. 2
0
 public void Copy(MessageProperties source)
 {
     AppId                 = source.AppId;
     ClusterId             = source.ClusterId;
     ConsumerQueue         = source.ConsumerQueue;
     ConsumerTag           = source.ConsumerTag;
     ContentEncoding       = source.ContentEncoding;
     ContentLength         = source.ContentLength;
     ContentType           = source.ContentType;
     CorrelationId         = source.CorrelationId;
     DeliveryMode          = source.DeliveryMode;
     DeliveryTag           = source.DeliveryTag;
     Expiration            = source.Expiration;
     InferredArgumentType  = source.InferredArgumentType;
     MessageCount          = source.MessageCount;
     Priority              = source.Priority;
     PublishSequenceNumber = source.PublishSequenceNumber;
     ReceivedDeliveryMode  = source.ReceivedDeliveryMode;
     ReceivedExchange      = source.ReceivedExchange;
     ReceivedRoutingKey    = source.ReceivedRoutingKey;
     ReceivedUserId        = source.ReceivedUserId;
     Redelivered           = source.Redelivered;
     ReplyTo               = source.ReplyTo;
     ReplyToAddress        = source.ReplyToAddress;
     Target                = source.Target;
     TargetMethod          = source.TargetMethod;
     Timestamp             = source.Timestamp;
     Type   = source.Type;
     UserId = source.UserId;
     FinalRetryForMessageWithNoId = source.FinalRetryForMessageWithNoId;
     LastInBatch = source.LastInBatch;
     foreach (var entry in source.Headers)
     {
         Headers[entry.Key] = entry.Value;
     }
 }
Esempio n. 3
0
 public MessageBuilder AndProperties(MessageProperties properties)
 {
     Properties = properties;
     return(this);
 }
Esempio n. 4
0
 private MessageBuilder(byte[] body, MessageProperties properties)
 {
     _body = body;
     CopyProperties(properties);
 }
Esempio n. 5
0
 public Message(byte[] body, MessageProperties messageProperties)
 {
     Body = body;
     MessageProperties = messageProperties;
 }
Esempio n. 6
0
 protected AbstractMessageBuilder(MessageProperties properties)
 {
     Properties = properties;
 }