Search in sources :

Example 1 with ReplicationEndpoint

use of org.apache.activemq.artemis.core.replication.ReplicationEndpoint in project activemq-artemis by apache.

the class BackupSyncDelay method intercept.

@Override
public boolean intercept(Packet packet, RemotingConnection connection) throws ActiveMQException {
    if (packet.getType() == PacketImpl.BACKUP_REGISTRATION) {
        try {
            SharedNothingBackupActivation activation = (SharedNothingBackupActivation) backup.getActivation();
            ReplicationEndpoint repEnd = activation.getReplicationEndpoint();
            handler.addSubHandler(repEnd);
            Channel repChannel = repEnd.getChannel();
            repChannel.setHandler(handler);
            handler.setChannel(repChannel);
            live.getRemotingService().removeIncomingInterceptor(this);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
    return true;
}
Also used : ReplicationEndpoint(org.apache.activemq.artemis.core.replication.ReplicationEndpoint) Channel(org.apache.activemq.artemis.core.protocol.core.Channel) SharedNothingBackupActivation(org.apache.activemq.artemis.core.server.impl.SharedNothingBackupActivation) ActiveMQException(org.apache.activemq.artemis.api.core.ActiveMQException)

Example 2 with ReplicationEndpoint

use of org.apache.activemq.artemis.core.replication.ReplicationEndpoint in project activemq-artemis by apache.

the class SharedNothingBackupActivation method init.

public void init() throws Exception {
    assert replicationEndpoint == null;
    activeMQServer.resetNodeManager();
    backupUpToDate = false;
    replicationEndpoint = new ReplicationEndpoint(activeMQServer, shutdownOnCriticalIO, attemptFailBack, this);
}
Also used : ReplicationEndpoint(org.apache.activemq.artemis.core.replication.ReplicationEndpoint)

Aggregations

ReplicationEndpoint (org.apache.activemq.artemis.core.replication.ReplicationEndpoint)2 ActiveMQException (org.apache.activemq.artemis.api.core.ActiveMQException)1 Channel (org.apache.activemq.artemis.core.protocol.core.Channel)1 SharedNothingBackupActivation (org.apache.activemq.artemis.core.server.impl.SharedNothingBackupActivation)1