Package org.nustaq.kontraktor.routers
Class SimpleKrouter
java.lang.Object
org.nustaq.kontraktor.Actors
org.nustaq.kontraktor.Actor<T>
org.nustaq.kontraktor.routers.AbstractKrouter<T>
org.nustaq.kontraktor.routers.SingleActiveServiceKrouter<SimpleKrouter>
org.nustaq.kontraktor.routers.SimpleKrouter
- All Implemented Interfaces:
java.io.Serializable,java.util.concurrent.Executor,Monitorable,RemotedActor,ServingActor
public class SimpleKrouter extends SingleActiveServiceKrouter<SimpleKrouter>
a Krouter supporting dynamic replacement of a single service. For stateful service's,
clients keep connected to the service instance they originally
connected. Once this old service terminates they failover to the "current" service instance.
THIS IS NOT A FAILOVER: if the primary (least recently connected) service goes down, no new service
can connect ('service unavailable), however clients connected to a previous service instance will continue working.
Use HotColdFailover for dynamic failover + dynamic replacement use cases.
Use case: Replacement / Zero Downtime software update. In general its favourable to always
use HotColdFailover instead of SimpleKrouter, as this also covers dynamic replacement. (SimpleKrouter's
orinigal role was having a simple case for testing debugging).
- See Also:
- Serialized Form
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.nustaq.kontraktor.routers.AbstractKrouter
CLIENT_PING_INTERVAL_MS, clients, lastSwitch, nextAliveRemoteActors, SERVICE_UNAVAILABLE, timeoutMapFields inherited from class org.nustaq.kontraktor.Actor
__cbQueue, __clientConnection, __connections, __currentDispatcher, __mailbox, __mailboxCapacity, __mbCapacity, __publishTarget, __remoteId, __scheduler, __self, __stopped, __ticketMachine, connection, sender, userData, zzRoutingGCEnabled, zzServerMsgCallbackFields inherited from class org.nustaq.kontraktor.Actors
CONT, DEFAULT_TIMOUT, defaultScheduler, delayedCalls, exec, instance, MAX_EXTERNAL_THREADS_POOL_SIZE, version -
Constructor Summary
Constructors Constructor Description SimpleKrouter() -
Method Summary
Modifier and Type Method Description protected ActorgetRemoteRef()voidrouter$handleServiceDisconnect(Actor x)protected voidsetRemoteRef(Actor remoteRef)Methods inherited from class org.nustaq.kontraktor.routers.SingleActiveServiceKrouter
dispatchRemoteCall, getServices, init, main, router$RegisterService, willDispatchMethods inherited from class org.nustaq.kontraktor.routers.AbstractKrouter
__dispatchRemoteCall, checkPingOnClients, clientConnected, clientDisconnected, createErrorPromiseResponse, forwardCall, forwardCallInternal, forwardMultiCall, forwardMultiCallInternal, getClientPingTimeout, getServicePingTimeout, handleServiceDiscon, hasBeenUnpublished, isStateful, pingServices, router$clientPing, sendFailoverNotification, sendFailoverNotificationInternalMethods inherited from class org.nustaq.kontraktor.Actor
__addDeadLetter, __addRemoteConnection, __addStopHandler, __enqueueCall, __getCachedMethod, __removeRemoteConnection, __stop, __stopImpl, __submit, ask, askMsg, asyncstop, checkThread, close, closeCurrentClient, current, cyclic, debounce, delayed, execInThreadPool, execute, getActor, getActorRef, getCallbackSize, getConnections, getCurrentDispatcher, getFactory, getMailboxSize, getQSizes, getReport, getScheduler, getSubMonitorables, getUntypedRef, hasStopped, inside, inThread, isCallbackQPressured, isEmpty, isMailboxPressured, isProxy, isPublished, isRemote, isStopped, ping, self, serialOn, setServerMsgCallback, stop, stopSafeClose, tell, tellMsg, unpublish, zzkrouterLostClient, zzRoutingRefGCMethods inherited from class org.nustaq.kontraktor.Actors
AddDeadLetter, all, all, all, allMapped, AsActor, AsActor, AsActor, AsActor, AsUntypedActor, awaitAll, awaitAll, awaitAll, awaitAll, complete, complete, DeadLetters, flow, InThread, isComplete, isCont, isError, isErrorOrComplete, isResult, isTimeout, kYield, kYield, promise, race, race, reject, resolve, resolve, stream, SubmitDelayed, yieldCallbacks
-
Constructor Details
-
SimpleKrouter
public SimpleKrouter()
-
-
Method Details
-
getRemoteRef
- Specified by:
getRemoteRefin classSingleActiveServiceKrouter<SimpleKrouter>
-
setRemoteRef
- Specified by:
setRemoteRefin classSingleActiveServiceKrouter<SimpleKrouter>
-
router$handleServiceDisconnect
- Specified by:
router$handleServiceDisconnectin classSingleActiveServiceKrouter<SimpleKrouter>
-