@Override public boolean reattachOnNewConnection(RemotingConnection newConnection) throws ActiveMQException { this.remotingConnection = newConnection; sessionChannel.transferConnection((CoreRemotingConnection) newConnection); Packet request = new ReattachSessionMessage(name, sessionChannel.getLastConfirmedCommandID()); Channel channel1 = getCoreConnection().getChannel(1, -1); ReattachSessionResponseMessage response = (ReattachSessionResponseMessage) channel1.sendBlocking(request, PacketImpl.REATTACH_SESSION_RESP); if (response.isReattached()) { ActiveMQClientLogger.LOGGER.replayingCommands(sessionChannel.getID(), response.getLastConfirmedCommandID()); // The session was found on the server - we reattached transparently ok sessionChannel.replayCommands(response.getLastConfirmedCommandID()); return true; } else { ActiveMQClientLogger.LOGGER.reconnectCreatingNewSession(sessionChannel.getID()); sessionChannel.clearCommands(); return false; } }
@Override public boolean reattachOnNewConnection(RemotingConnection newConnection) throws ActiveMQException { this.remotingConnection = newConnection; sessionChannel.transferConnection((CoreRemotingConnection) newConnection); Packet request = new ReattachSessionMessage(name, sessionChannel.getLastConfirmedCommandID()); Channel channel1 = getCoreConnection().getChannel(1, -1); ReattachSessionResponseMessage response = (ReattachSessionResponseMessage) channel1.sendBlocking(request, PacketImpl.REATTACH_SESSION_RESP); if (response.isReattached()) { ActiveMQClientLogger.LOGGER.replayingCommands(sessionChannel.getID(), response.getLastConfirmedCommandID()); // The session was found on the server - we reattached transparently ok sessionChannel.replayCommands(response.getLastConfirmedCommandID()); return true; } else { ActiveMQClientLogger.LOGGER.reconnectCreatingNewSession(sessionChannel.getID()); sessionChannel.clearCommands(); return false; } }
@Override public boolean reattachOnNewConnection(RemotingConnection newConnection) throws ActiveMQException { this.remotingConnection = newConnection; sessionChannel.transferConnection((CoreRemotingConnection) newConnection); Packet request = new ReattachSessionMessage(name, sessionChannel.getLastConfirmedCommandID()); Channel channel1 = getCoreConnection().getChannel(1, -1); ReattachSessionResponseMessage response = (ReattachSessionResponseMessage) channel1.sendBlocking(request, PacketImpl.REATTACH_SESSION_RESP); if (response.isReattached()) { ActiveMQClientLogger.LOGGER.replayingCommands(sessionChannel.getID(), response.getLastConfirmedCommandID()); // The session was found on the server - we reattached transparently ok sessionChannel.replayCommands(response.getLastConfirmedCommandID()); return true; } else { ActiveMQClientLogger.LOGGER.reconnectCreatingNewSession(sessionChannel.getID()); sessionChannel.clearCommands(); return false; } }
@Override public boolean reattachOnNewConnection(RemotingConnection newConnection) throws ActiveMQException { this.remotingConnection = newConnection; sessionChannel.transferConnection((CoreRemotingConnection) newConnection); Packet request = new ReattachSessionMessage(name, sessionChannel.getLastConfirmedCommandID()); Channel channel1 = getCoreConnection().getChannel(1, -1); ReattachSessionResponseMessage response = (ReattachSessionResponseMessage) channel1.sendBlocking(request, PacketImpl.REATTACH_SESSION_RESP); if (response.isReattached()) { ActiveMQClientLogger.LOGGER.replayingCommands(sessionChannel.getID(), response.getLastConfirmedCommandID()); // The session was found on the server - we reattached transparently ok sessionChannel.replayCommands(response.getLastConfirmedCommandID()); return true; } else { ActiveMQClientLogger.LOGGER.reconnectCreatingNewSession(sessionChannel.getID()); sessionChannel.clearCommands(); return false; } }
@Override public boolean reattachOnNewConnection(RemotingConnection newConnection) throws ActiveMQException { this.remotingConnection = newConnection; sessionChannel.transferConnection((CoreRemotingConnection) newConnection); Packet request = new ReattachSessionMessage(name, sessionChannel.getLastConfirmedCommandID()); Channel channel1 = getCoreConnection().getChannel(1, -1); ReattachSessionResponseMessage response = (ReattachSessionResponseMessage) channel1.sendBlocking(request, PacketImpl.REATTACH_SESSION_RESP); if (response.isReattached()) { ActiveMQClientLogger.LOGGER.replayingCommands(sessionChannel.getID(), response.getLastConfirmedCommandID()); // The session was found on the server - we reattached transparently ok sessionChannel.replayCommands(response.getLastConfirmedCommandID()); return true; } else { ActiveMQClientLogger.LOGGER.reconnectCreatingNewSession(sessionChannel.getID()); sessionChannel.clearCommands(); return false; } }
@Override public boolean reattachOnNewConnection(RemotingConnection newConnection) throws ActiveMQException { this.remotingConnection = newConnection; sessionChannel.transferConnection((CoreRemotingConnection) newConnection); Packet request = new ReattachSessionMessage(name, sessionChannel.getLastConfirmedCommandID()); Channel channel1 = getCoreConnection().getChannel(1, -1); ReattachSessionResponseMessage response = (ReattachSessionResponseMessage) channel1.sendBlocking(request, PacketImpl.REATTACH_SESSION_RESP); if (response.isReattached()) { ActiveMQClientLogger.LOGGER.replayingCommands(sessionChannel.getID(), response.getLastConfirmedCommandID()); // The session was found on the server - we reattached transparently ok sessionChannel.replayCommands(response.getLastConfirmedCommandID()); return true; } else { ActiveMQClientLogger.LOGGER.reconnectCreatingNewSession(sessionChannel.getID()); sessionChannel.clearCommands(); return false; } }
@Override public boolean reattachOnNewConnection(RemotingConnection newConnection) throws ActiveMQException { this.remotingConnection = newConnection; sessionChannel.transferConnection((CoreRemotingConnection) newConnection); Packet request = new ReattachSessionMessage(name, sessionChannel.getLastConfirmedCommandID()); Channel channel1 = getCoreConnection().getChannel(1, -1); ReattachSessionResponseMessage response = (ReattachSessionResponseMessage) channel1.sendBlocking(request, PacketImpl.REATTACH_SESSION_RESP); if (response.isReattached()) { ActiveMQClientLogger.LOGGER.replayingCommands(sessionChannel.getID(), response.getLastConfirmedCommandID()); // The session was found on the server - we reattached transparently ok sessionChannel.replayCommands(response.getLastConfirmedCommandID()); return true; } else { ActiveMQClientLogger.LOGGER.reconnectCreatingNewSession(sessionChannel.getID()); sessionChannel.clearCommands(); return false; } }
remotingConnection.setFailureListeners(failureListeners); int serverLastReceivedCommandID = channel.getLastConfirmedCommandID();