merge #27 - revert any new protocol headers to keep backward compatibility

This commit is contained in:
Andy Taylor 2014-12-10 12:01:50 +00:00
commit 09a6fee020
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;
// 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");
public static final SimpleString FORCED_DELIVERY_MESSAGE = new SimpleString("_hornetq.forced.delivery.seq");
// Attributes
// -----------------------------------------------------------------------------------

View File

@ -481,7 +481,7 @@ public class ActiveMQClientProtocolManager implements ClientProtocolManager
if (transportConnection.isUsingProtocolHandling())
{
// 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());
amqbuffer.writeBytes(handshake.getBytes());
transportConnection.write(amqbuffer);

View File

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