Skip to content
Permalink
Browse files
https://issues.apache.org/activemq/browse/AMQNET-292
Add the clone method to ensure the Message state is correct and properties aren't set read-only when CopyOnSend is set.
  • Loading branch information
Timothy A. Bish committed Nov 11, 2010
1 parent 923fd4c commit 4c3a72917426235d9fded06d3f88e08c7aa4f3ab
Showing 1 changed file with 8 additions and 0 deletions.
@@ -66,6 +66,14 @@ public virtual bool Equals(Message that)
return thisMsg != null && oMsg != null && oMsg.Equals(thisMsg);
}

public override object Clone()
{
Message cloneMessage = (Message) base.Clone();

cloneMessage.propertyHelper = new MessagePropertyIntercepter(cloneMessage, cloneMessage.properties, this.ReadOnlyProperties) { AllowByteArrays = false };
return cloneMessage;
}

public void Acknowledge()
{
if(null == Acknowledger)

0 comments on commit 4c3a729

Please sign in to comment.