Class AbstractPersistentActorWithAtLeastOnceDelivery

    • Constructor Detail

      • AbstractPersistentActorWithAtLeastOnceDelivery

        public AbstractPersistentActorWithAtLeastOnceDelivery()
    • Method Detail

      • deliver

        public void deliver​(ActorPath destination,
                            Function<java.lang.Long,​java.lang.Object> deliveryIdToMessage)
      • deliver

        public void deliver​(ActorSelection destination,
                            Function<java.lang.Long,​java.lang.Object> deliveryIdToMessage)
        Java API: Send the message created by the deliveryIdToMessage function to the destination actor. It will retry sending the message until the delivery is confirmed with AtLeastOnceDeliveryLike.confirmDelivery(long). Correlation between deliver and confirmDelivery is performed with the deliveryId that is provided as parameter to the deliveryIdToMessage function. The deliveryId is typically passed in the message to the destination, which replies with a message containing the same deliveryId.

        The deliveryId is a strictly monotonically increasing sequence number without gaps. The same sequence is used for all destinations, i.e. when sending to multiple destinations the destinations will see gaps in the sequence if no translation is performed.

        During recovery this method will not send out the message, but it will be sent later if no matching confirmDelivery was performed.

        This method will throw AtLeastOnceDelivery.MaxUnconfirmedMessagesExceededException if AtLeastOnceDeliveryLike.numberOfUnconfirmed() is greater than or equal to AtLeastOnceDeliveryLike.maxUnconfirmedMessages().

        Parameters:
        destination - (undocumented)
        deliveryIdToMessage - (undocumented)