Efficient log checks in STOMP encoder/decoder
This commit is contained in:
@@ -160,9 +160,7 @@ public class StompDecoder {
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Incomplete frame, resetting input buffer...");
|
||||
}
|
||||
logger.trace("Incomplete frame, resetting input buffer...");
|
||||
if (headers != null && headerAccessor != null) {
|
||||
String name = NativeMessageHeaderAccessor.NATIVE_HEADERS;
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -299,7 +297,9 @@ public class StompDecoder {
|
||||
contentLength = headerAccessor.getContentLength();
|
||||
}
|
||||
catch (NumberFormatException ex) {
|
||||
logger.warn("Ignoring invalid content-length: '" + headerAccessor);
|
||||
if (logger.isWarnEnabled()) {
|
||||
logger.warn("Ignoring invalid content-length: '" + headerAccessor);
|
||||
}
|
||||
contentLength = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -98,9 +98,7 @@ public class StompEncoder {
|
||||
DataOutputStream output = new DataOutputStream(baos);
|
||||
|
||||
if (SimpMessageType.HEARTBEAT.equals(SimpMessageHeaderAccessor.getMessageType(headers))) {
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Encoding heartbeat");
|
||||
}
|
||||
logger.trace("Encoding heartbeat");
|
||||
output.write(StompDecoder.HEARTBEAT_PAYLOAD);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user