diff --git a/activemq-core/src/main/java/org/apache/activemq/command/CommandTypes.java b/activemq-core/src/main/java/org/apache/activemq/command/CommandTypes.java index a3e88981b8..bc2f5ce111 100755 --- a/activemq-core/src/main/java/org/apache/activemq/command/CommandTypes.java +++ b/activemq-core/src/main/java/org/apache/activemq/command/CommandTypes.java @@ -26,6 +26,10 @@ public interface CommandTypes { // What is the latest version of the openwire protocol byte PROTOCOL_VERSION = 7; + // What is the latest version of the openwire protocol used in the stores + byte PROTOCOL_STORE_VERSION = 6; + + // A marshaling layer can use this type to specify a null object. byte NULL = 0; 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 6c0d0c6b95..d9375ba32e 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 @@ -38,7 +38,7 @@ import org.apache.activemq.wireformat.WireFormat; */ public final class OpenWireFormat implements WireFormat { - public static final int DEFAULT_VERSION = CommandTypes.PROTOCOL_VERSION; + public static final int DEFAULT_VERSION = CommandTypes.PROTOCOL_STORE_VERSION; static final byte NULL_TYPE = CommandTypes.NULL; private static final int MARSHAL_CACHE_SIZE = Short.MAX_VALUE / 2; diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormatFactory.java b/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormatFactory.java index cfb4e40355..083c155484 100755 --- a/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormatFactory.java +++ b/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormatFactory.java @@ -16,6 +16,7 @@ */ package org.apache.activemq.openwire; +import org.apache.activemq.command.CommandTypes; import org.apache.activemq.command.WireFormatInfo; import org.apache.activemq.wireformat.WireFormat; import org.apache.activemq.wireformat.WireFormatFactory; @@ -30,7 +31,7 @@ public class OpenWireFormatFactory implements WireFormatFactory { // default negotiation. // - private int version = OpenWireFormat.DEFAULT_VERSION; + private int version = CommandTypes.PROTOCOL_VERSION; private boolean stackTraceEnabled = true; private boolean tcpNoDelayEnabled = true; private boolean cacheEnabled = true; @@ -59,7 +60,7 @@ public class OpenWireFormatFactory implements WireFormatFactory { throw ise; } - OpenWireFormat f = new OpenWireFormat(); + OpenWireFormat f = new OpenWireFormat(version); f.setPreferedWireFormatInfo(info); return f; }