Author: gtully
Date: Mon Mar 28 15:41:18 2011
New Revision: 1086277
URL: http://svn.apache.org/viewvc?rev=1086277&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3236 - preserve store compatability
with new ack attribute. Only use version 7 openwire on the wire, persist using
version 6 format. New ack cause attribute does not need to persist as it gets
set in a DLQ message property. resolve regression -
org.apache.activemq.store.amq.reader.AMQReaderTest.testIterateArchive
Modified:
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/CommandTypes.java
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormatFactory.java
Modified:
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/CommandTypes.java
URL:
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/CommandTypes.java?rev=1086277&r1=1086276&r2=1086277&view=diff
==============================================================================
---
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/CommandTypes.java
(original)
+++
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/CommandTypes.java
Mon Mar 28 15:41:18 2011
@@ -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;
Modified:
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java
URL:
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java?rev=1086277&r1=1086276&r2=1086277&view=diff
==============================================================================
---
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java
(original)
+++
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java
Mon Mar 28 15:41:18 2011
@@ -38,7 +38,7 @@ import org.apache.activemq.wireformat.Wi
*/
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;
Modified:
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormatFactory.java
URL:
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormatFactory.java?rev=1086277&r1=1086276&r2=1086277&view=diff
==============================================================================
---
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormatFactory.java
(original)
+++
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormatFactory.java
Mon Mar 28 15:41:18 2011
@@ -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 imple
// 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 imple
throw ise;
}
- OpenWireFormat f = new OpenWireFormat();
+ OpenWireFormat f = new OpenWireFormat(version);
f.setPreferedWireFormatInfo(info);
return f;
}