All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.netflix.eureka2.server.channel.ReplicationChannel Maven / Gradle / Ivy

The newest version!
package com.netflix.eureka2.server.channel;

import com.netflix.eureka2.protocol.replication.ReplicationHello;
import com.netflix.eureka2.protocol.replication.ReplicationHelloReply;
import com.netflix.eureka2.registry.InstanceInfo;
import com.netflix.eureka2.server.registry.Source;
import com.netflix.eureka2.channel.ServiceChannel;
import rx.Observable;

/**
 * A {@link com.netflix.eureka2.channel.ServiceChannel} implementation representing a replication stream
 * between two Eureka write servers.
 *
 * The client side of the channel is a source of data, that comes from its own registry, and is limited
 * to entries with {@link Source.Origin#LOCAL}.
 *
 * On the server side the data are put into the registry with origin set to {@link Source.Origin#REPLICATED}.
 * A replicated entry is removed from the registry under following circumstances:
 * 
    *
  • Explicit {@link #unregister(String)} call - an entry was removed from the source registry
  • *
  • Replication connection termination - invalidates all entries replicated over this connection
  • *
  • No heartbeat within configured period of time - equivalent to connection termination
  • *
* * @author Nitesh Kant */ public interface ReplicationChannel extends ServiceChannel { /** * Handshake message exchange. A client sends first {@link ReplicationHello} message, which * is followed by the {@link ReplicationHelloReply} from the server. * * @param hello initial message from the client * @return reply message from the server */ Observable hello(ReplicationHello hello); /** * Registers the passed instance with eureka. * * @param instanceInfo The instance definition. * * @return Acknowledgment for the registration. */ Observable register(InstanceInfo instanceInfo); /** * Updates the {@link InstanceInfo} registered with this channel. * * @param newInfo The updated info. * * @return Acknowledgment for this update. */ Observable update(InstanceInfo newInfo); /** * Unregisters the {@link InstanceInfo} with given id. * * @return Acknowledgment for unregistration. */ Observable unregister(String instanceId); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy