diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java b/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java index 8dfa926310..d09a70014b 100755 --- a/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java +++ b/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java @@ -565,7 +565,7 @@ final public class OpenWireFormat implements WireFormat { if( preferedWireFormatInfo==null ) throw new IllegalStateException("Wireformat cannot not be renegotiated."); - this.setVersion(Math.max(preferedWireFormatInfo.getVersion(), info.getVersion()) ); + this.setVersion(Math.min(preferedWireFormatInfo.getVersion(), info.getVersion()) ); this.stackTraceEnabled = info.isStackTraceEnabled() && preferedWireFormatInfo.isStackTraceEnabled(); this.tcpNoDelayEnabled = info.isTcpNoDelayEnabled() && preferedWireFormatInfo.isTcpNoDelayEnabled(); this.cacheEnabled = info.isCacheEnabled() && preferedWireFormatInfo.isCacheEnabled();