Github user clebertsuconic commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1959#discussion_r175767855
  
    --- Diff: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/LargeServerMessageImpl.java
 ---
    @@ -347,24 +351,31 @@ public SequentialFile getFile() throws 
ActiveMQException {
     
        @Override
        public long getPersistentSize() throws ActiveMQException {
    +      return getPersistentSize(false);
    +   }
    +
    +   private long getPersistentSize(boolean keepFileState) throws 
ActiveMQException {
           long size = super.getPersistentSize();
    -      size += getBodyEncoder().getLargeBodySize();
    +      size += getBodyEncoder(keepFileState).getLargeBodySize();
     
           return size;
        }
    +
        @Override
        public String toString() {
           try {
    -         return "LargeServerMessage[messageID=" + messageID + ",durable=" 
+ isDurable() + ",userID=" + getUserID() + ",priority=" + this.getPriority() + 
", timestamp=" + toDate(getTimestamp()) + ",expiration=" + 
toDate(getExpiration()) + ", durable=" + durable + ", address=" + getAddress() 
+ ",size=" + getPersistentSize() + ",properties=" + (properties != null ? 
properties.toString() : "") + "]@" + System.identityHashCode(this);
    +         return "LargeServerMessage[messageID=" + messageID + ",durable=" 
+ isDurable() + ",userID=" + getUserID() + ",priority=" + this.getPriority() + 
", timestamp=" + toDate(getTimestamp()) + ",expiration=" + 
toDate(getExpiration()) + ", durable=" + durable + ", address=" + getAddress() 
+ ",size=" + getPersistentSize(true) + ",properties=" + (properties != null ? 
properties.toString() : "") + "]@" + System.identityHashCode(this);
    --- End diff --
    
    just remove the fileSize from here... and that's the only change you will 
need.


---

Reply via email to