Class CommandDistributionBehavior

java.lang.Object
io.camunda.zeebe.engine.processing.distribution.CommandDistributionBehavior

public final class CommandDistributionBehavior extends Object
The network communication between the partitions is unreliable. To allow communication between partitions in a reliable way, we've built command distribution: a way for partitions to send, receive, and acknowledge (or retry sending) commands between partitions.

This behavior allows distributing a command to other partitions, and for those receiving partitions to acknowledge the distributed commands back to the partition that started.

See Also:
  • Constructor Details

  • Method Details

    • withKey

      public CommandDistributionBehavior.RequestBuilder withKey(long distributionKey)
      Starts a new command distribution request.
      Parameters:
      distributionKey - the key to identify this unique command distribution. The key is used to store the pending distribution, as the key of distributed command, to identify the distributing partition when processing the distributed command, and as the key to correlate the ACKNOWLEDGE command to the pending distribution. This can be a newly generated key, or the key identifying the entity that's being distributed. Please note that it must be unique for command distribution. Don't reuse the key to distribute another command. Don't reuse the key to distribute another command until the previous command distribution has been completed. Additionally, the key determines the order in which the commands are distributed if they are distributed ordered, i.e. a queue is specified.
    • acknowledgeCommand

      public <T extends UnifiedRecordValue> void acknowledgeCommand(TypedRecord<T> command)
      Acknowledges that a command was distributed to another partition successfully.
      Parameters:
      command - the command that was distributed