akka.persistence
Class PersistentChannel

java.lang.Object
  extended by akka.persistence.PersistentChannel
All Implemented Interfaces:
Actor

public final class PersistentChannel
extends java.lang.Object
implements Actor

A PersistentChannel implements the same functionality as a Channel but additionally persists Deliver requests before they are served. Persistent channels are useful in combination with slow destinations or destinations that are unavailable for a long time. Deliver requests that have been persisted by a persistent channel are deleted when destinations confirm the receipt of the corresponding messages.

The number of pending confirmations can be limited by a persistent channel based on the parameters of PersistentChannelSettings. It can suspend delivery when the number of pending confirmations reaches pendingConfirmationsMax and resume delivery again when this number falls below pendingConfirmationsMin. This prevents both flooding destinations with more messages than they can process and unlimited memory consumption by the channel. A persistent channel continues to persist Deliver request even when message delivery is temporarily suspended.

A persistent channel can also reply to Deliver senders if the request has been successfully persisted or not (see replyPersistent parameter in PersistentChannelSettings). In case of success, the channel replies with the contained Persistent message, otherwise with a PersistenceFailure message.


Nested Class Summary
 
Nested classes/interfaces inherited from interface akka.actor.Actor
Actor.emptyBehavior$
 
Constructor Summary
PersistentChannel(scala.Option<java.lang.String> _channelId, PersistentChannelSettings channelSettings)
           
 
Method Summary
static Props props()
          Returns a channel actor configuration object for creating a PersistentChannel with a generated id and default PersistentChannelSettings.
static Props props(PersistentChannelSettings channelSettings)
          Returns a channel actor configuration object for creating a PersistentChannel with a generated id and specified channelSettings.
static Props props(java.lang.String channelId)
          Returns a channel actor configuration object for creating a PersistentChannel with the specified id and default PersistentChannelSettings.
static Props props(java.lang.String channelId, PersistentChannelSettings channelSettings)
          Returns a channel actor configuration object for creating a PersistentChannel with the specified id and specified channelSettings.
 scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive()
          This defines the initial actor behavior, it must return a partial function with the actor logic.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface akka.actor.Actor
aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, context, postRestart, postStop, preRestart, preStart, self, sender, supervisorStrategy, unhandled
 

Constructor Detail

PersistentChannel

public PersistentChannel(scala.Option<java.lang.String> _channelId,
                         PersistentChannelSettings channelSettings)
Method Detail

props

public static Props props()
Returns a channel actor configuration object for creating a PersistentChannel with a generated id and default PersistentChannelSettings.

Returns:
(undocumented)

props

public static Props props(PersistentChannelSettings channelSettings)
Returns a channel actor configuration object for creating a PersistentChannel with a generated id and specified channelSettings.

Parameters:
channelSettings - channel configuration object.
Returns:
(undocumented)

props

public static Props props(java.lang.String channelId)
Returns a channel actor configuration object for creating a PersistentChannel with the specified id and default PersistentChannelSettings.

Parameters:
channelId - channel id.
Returns:
(undocumented)

props

public static Props props(java.lang.String channelId,
                          PersistentChannelSettings channelSettings)
Returns a channel actor configuration object for creating a PersistentChannel with the specified id and specified channelSettings.

Parameters:
channelId - channel id.
channelSettings - channel configuration object.
Returns:
(undocumented)

receive

public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive()
Description copied from interface: Actor
This defines the initial actor behavior, it must return a partial function with the actor logic.

Specified by:
receive in interface Actor
Returns:
(undocumented)