" is not compatible with server version " +
version.getFullVersion() +
". " +
"Please ensure all clients and servers are upgraded to the same version for them to " +
"interoperate properly");
throw new HornetQException(HornetQException.INCOMPATIBLE_CLIENT_SERVER_VERSIONS,
"Server and client versions incompatible");
}
if (!server.isStarted())
{
throw new HornetQException(HornetQException.SESSION_CREATION_REJECTED, "Server not started");
}
if (!server.checkActivate())
{
throw new HornetQException(HornetQException.SESSION_CREATION_REJECTED,
"Server will not accept create session requests");
}
Channel channel = connection.getChannel(request.getSessionChannelID(), request.getWindowSize());
ServerSession session = server.createSession(request.getName(),
request.getUsername(),
request.getPassword(),
request.getMinLargeMessageSize(),
connection,
request.isAutoCommitSends(),
request.isAutoCommitAcks(),
request.isPreAcknowledge(),
request.isXA(),
request.getDefaultAddress(),
new CoreSessionCallback(request.getName(),
protocolManager,
channel));
session.setSessionContext(server.getStorageManager().newContext(server.getExecutorFactory().getExecutor()));
ServerSessionPacketHandler handler = new ServerSessionPacketHandler(session,
server.getStorageManager(),
channel);
channel.setHandler(handler);
// TODO - where is this removed?
protocolManager.addSessionHandler(request.getName(), handler);
response = new CreateSessionResponseMessage(server.getVersion().getIncrementingVersion());
}
catch (HornetQException e)
{
log.error("Failed to create session ", e);
response = new HornetQExceptionMessage((HornetQException)e);
if (e.getCode() == HornetQException.INCOMPATIBLE_CLIENT_SERVER_VERSIONS)
{
incompatibleVersion = true;
}
}
catch (Exception e)
{
log.error("Failed to create session ", e);
HornetQPacketHandler.log.error("Failed to create session", e);
response = new HornetQExceptionMessage(new HornetQException(HornetQException.INTERNAL_ERROR));
}
// send the exception to the client and destroy
// the connection if the client and server versions
// are not compatible