Improve GenericMessage.toString()
Restore pringing the payload first and headers second as it has been in SI but also handle specifically the case where the body is a byte array to minimize unnecessary "noise" that causes otherwise for STOMP msgs.
This commit is contained in:
@@ -82,9 +82,15 @@ public class GenericMessage<T> implements Message<T>, Serializable {
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder("[Headers=" + this.headers + "]");
|
||||
sb.append("[Payload ").append(this.payload.getClass().getSimpleName());
|
||||
sb.append(" content=").append(this.payload).append("]");
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (byte[].class.equals(this.payload.getClass())) {
|
||||
sb.append("[Payload byte[").append(((byte[]) this.payload).length).append("]]");
|
||||
}
|
||||
else {
|
||||
sb.append("[Payload ").append(this.payload.getClass().getSimpleName());
|
||||
sb.append(" content=").append(this.payload).append("]");
|
||||
}
|
||||
sb.append("[Headers=" + this.headers + "]");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user