Changed core protocol handshake to use ARTEMIS

This commit is contained in:
Martyn Taylor 2015-05-07 12:16:58 +01:00
parent 930df932b3
commit f07af67632
2 changed files with 9 additions and 8 deletions

View File

@ -74,6 +74,8 @@ import org.apache.activemq.artemis.utils.VersionLoader;
public class ActiveMQClientProtocolManager implements ClientProtocolManager
{
private static final String handshake = "ARTEMIS";
private final int versionID = VersionLoader.getVersion().getIncrementingVersion();
private ClientSessionFactoryInternal factoryInternal;
@ -479,7 +481,6 @@ public class ActiveMQClientProtocolManager implements ClientProtocolManager
if (transportConnection.isUsingProtocolHandling())
{
// no need to send handshake on inVM as inVM is not using the NettyProtocolHandling
String handshake = "HORNETQ";
ActiveMQBuffer amqbuffer = connection.createTransportBuffer(handshake.length());
amqbuffer.writeBytes(handshake.getBytes());
transportConnection.write(amqbuffer);

View File

@ -185,13 +185,13 @@ class CoreProtocolManager implements ProtocolManager<Interceptor>
public void handshake(NettyServerConnection connection, ActiveMQBuffer buffer)
{
//if we are not an old client then handshake
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')
if (buffer.getByte(0) == 'A' &&
buffer.getByte(1) == 'R' &&
buffer.getByte(2) == 'T' &&
buffer.getByte(3) == 'E' &&
buffer.getByte(4) == 'M' &&
buffer.getByte(5) == 'I' &&
buffer.getByte(6) == 'S')
{
//todo add some handshaking
buffer.readBytes(7);