ACTIVEMQ6-50 revert any new protocol headers to keep backward compatibility

- revert the FORCED_DELIVERY_MESSAGE
   back to "_hornetq"
 - revert handshake header back to 'HORNETQ'
This commit is contained in:
gaohoward 2014-12-10 11:15:53 +08:00
parent d5359535e7
commit ff42c217f5
3 changed files with 10 additions and 14 deletions

View File

@ -63,10 +63,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
private static final int NUM_PRIORITIES = 10; private static final int NUM_PRIORITIES = 10;
public static final SimpleString FORCED_DELIVERY_MESSAGE = new SimpleString("_hornetq.forced.delivery.seq");
// TODO: We need to set this to _hornetq | activemq based on the version of the protocol
// I have added a comment about this at https://issues.apache.org/jira/browse/ACTIVEMQ6-42
public static final SimpleString FORCED_DELIVERY_MESSAGE = new SimpleString("_activemq.forced.delivery.seq");
// Attributes // Attributes
// ----------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------

View File

@ -481,7 +481,7 @@ public class ActiveMQClientProtocolManager implements ClientProtocolManager
if (transportConnection.isUsingProtocolHandling()) if (transportConnection.isUsingProtocolHandling())
{ {
// no need to send handshake on inVM as inVM is not using the NettyProtocolHandling // no need to send handshake on inVM as inVM is not using the NettyProtocolHandling
String handshake = "ACTIVEMQ"; String handshake = "HORNETQ";
ActiveMQBuffer amqbuffer = connection.createBuffer(handshake.length()); ActiveMQBuffer amqbuffer = connection.createBuffer(handshake.length());
amqbuffer.writeBytes(handshake.getBytes()); amqbuffer.writeBytes(handshake.getBytes());
transportConnection.write(amqbuffer); transportConnection.write(amqbuffer);

View File

@ -166,17 +166,16 @@ class CoreProtocolManager implements ProtocolManager
public void handshake(NettyServerConnection connection, ActiveMQBuffer buffer) public void handshake(NettyServerConnection connection, ActiveMQBuffer buffer)
{ {
//if we are not an old client then handshake //if we are not an old client then handshake
if (buffer.getByte(0) == 'A' && if (buffer.getByte(0) == 'H' &&
buffer.getByte(1) == 'C' && buffer.getByte(1) == 'O' &&
buffer.getByte(2) == 'T' && buffer.getByte(2) == 'R' &&
buffer.getByte(3) == 'I' && buffer.getByte(3) == 'N' &&
buffer.getByte(4) == 'V' && buffer.getByte(4) == 'E' &&
buffer.getByte(5) == 'E' && buffer.getByte(5) == 'T' &&
buffer.getByte(6) == 'M' && buffer.getByte(6) == 'Q')
buffer.getByte(7) == 'Q')
{ {
//todo add some handshaking //todo add some handshaking
buffer.readBytes(8); buffer.readBytes(7);
} }
} }