Class SubscriptionCommandSender

java.lang.Object
io.camunda.zeebe.engine.processing.message.command.SubscriptionCommandSender

public class SubscriptionCommandSender extends Object
Send commands via the subscription endpoint. The commands are send as single messages (instead of request-response). To ensure that a command is received, each command has an ACK command which is send by the receiver.
+---------------------------------------------------------------------------------------------------------------------------------------+
|                                                       Message Partition                                                               |
|                                                                                                                                       |
+-----------^----------------+---------------------------+----------------------^-------------------------^------------------+----------+
            |                |                           |                      |                         |                  |
    +-------+------+  +------+--------+       +----------+---------+  +---------+---------+       +-------+-------+  +-------+--------+
    | Open Message |  | Open Process |       | Correlate Process |  | Correlate Message |       | Close Message |  | Close Process |
    | Subscription |  | Instance Sub  |       | Instance Sub       |  | Subscription      |       | Subscription  |  | Instance Sub   |
    +-------+------+  +------+--------+       +----------+---------+  +---------+---------+       +-------+-------+  +-------+--------+
            |                |                           |                      |                         |                  |
 +----------+----------------v---------------------------v----------------------+-------------------------+------------------v----------+
 |                                                                                                                                      |
 |                                                   Process Instance Partition                                                        |
 +--------------------------------------------------------------------------------------------------------------------------------------+
 
  • Constructor Summary

    Constructors
    Constructor
    Description
    SubscriptionCommandSender(int senderPartition, InterPartitionCommandSender interPartitionCommandSender)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    closeMessageSubscription(int subscriptionPartitionId, long processInstanceKey, long elementInstanceKey, org.agrona.DirectBuffer messageName, String tenantId)
     
    boolean
    closeProcessMessageSubscription(long processInstanceKey, long elementInstanceKey, org.agrona.DirectBuffer messageName, String tenantId)
     
    boolean
    correlateMessageSubscription(int subscriptionPartitionId, long processInstanceKey, long elementInstanceKey, org.agrona.DirectBuffer bpmnProcessId, org.agrona.DirectBuffer messageName, String tenantId)
     
    boolean
    correlateProcessMessageSubscription(long processInstanceKey, long elementInstanceKey, org.agrona.DirectBuffer bpmnProcessId, org.agrona.DirectBuffer messageName, long messageKey, org.agrona.DirectBuffer variables, org.agrona.DirectBuffer correlationKey, String tenantId)
     
    boolean
    openMessageSubscription(int subscriptionPartitionId, long processInstanceKey, long elementInstanceKey, org.agrona.DirectBuffer bpmnProcessId, org.agrona.DirectBuffer messageName, org.agrona.DirectBuffer correlationKey, boolean closeOnCorrelate, String tenantId)
     
    boolean
    openProcessMessageSubscription(long processInstanceKey, long elementInstanceKey, org.agrona.DirectBuffer messageName, boolean closeOnCorrelate, String tenantId)
     
    boolean
    rejectCorrelateMessageSubscription(int subscriptionPartitionId, long processInstanceKey, long elementInstanceKey, org.agrona.DirectBuffer bpmnProcessId, long messageKey, org.agrona.DirectBuffer messageName, org.agrona.DirectBuffer correlationKey, String tenantId)
     
    void
    sendDirectCloseMessageSubscription(int subscriptionPartitionId, long processInstanceKey, long elementInstanceKey, org.agrona.DirectBuffer messageName, String tenantId)
    Sends the close message subscription command directly to the subscription partition.
    void
    sendDirectCorrelateProcessMessageSubscription(long processInstanceKey, long elementInstanceKey, org.agrona.DirectBuffer bpmnProcessId, org.agrona.DirectBuffer messageName, long messageKey, org.agrona.DirectBuffer variables, org.agrona.DirectBuffer correlationKey, String tenantId)
    Sends the correlate process message subscription command directly to the subscribed partition.
    void
    sendDirectOpenMessageSubscription(int subscriptionPartitionId, long processInstanceKey, long elementInstanceKey, org.agrona.DirectBuffer bpmnProcessId, org.agrona.DirectBuffer messageName, org.agrona.DirectBuffer correlationKey, boolean closeOnCorrelate, String tenantId)
    Sends the open message subscription command directly to the subscription partition.
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SubscriptionCommandSender

      public SubscriptionCommandSender(int senderPartition, InterPartitionCommandSender interPartitionCommandSender)
  • Method Details

    • openMessageSubscription

      public boolean openMessageSubscription(int subscriptionPartitionId, long processInstanceKey, long elementInstanceKey, org.agrona.DirectBuffer bpmnProcessId, org.agrona.DirectBuffer messageName, org.agrona.DirectBuffer correlationKey, boolean closeOnCorrelate, String tenantId)
    • sendDirectOpenMessageSubscription

      public void sendDirectOpenMessageSubscription(int subscriptionPartitionId, long processInstanceKey, long elementInstanceKey, org.agrona.DirectBuffer bpmnProcessId, org.agrona.DirectBuffer messageName, org.agrona.DirectBuffer correlationKey, boolean closeOnCorrelate, String tenantId)
      Sends the open message subscription command directly to the subscription partition. This differs to ${link openMessageSubscription}, as the sending/writing is not delayed. Usually useful or used in scheduled tasks, which want to directly send commands.
      Parameters:
      subscriptionPartitionId - the partition Id which should receive the command
      processInstanceKey - the related process instance key
      elementInstanceKey - the related element instance key
      bpmnProcessId - the related process id
      messageName - the name of the message for which the subscription should be correlated
      correlationKey - the correlation key for which the message should be correlated
      closeOnCorrelate - indicates whether the subscription should be closed after correlation
      tenantId - the tenant id the message subscription is created for
    • openProcessMessageSubscription

      public boolean openProcessMessageSubscription(long processInstanceKey, long elementInstanceKey, org.agrona.DirectBuffer messageName, boolean closeOnCorrelate, String tenantId)
    • correlateProcessMessageSubscription

      public boolean correlateProcessMessageSubscription(long processInstanceKey, long elementInstanceKey, org.agrona.DirectBuffer bpmnProcessId, org.agrona.DirectBuffer messageName, long messageKey, org.agrona.DirectBuffer variables, org.agrona.DirectBuffer correlationKey, String tenantId)
    • sendDirectCorrelateProcessMessageSubscription

      public void sendDirectCorrelateProcessMessageSubscription(long processInstanceKey, long elementInstanceKey, org.agrona.DirectBuffer bpmnProcessId, org.agrona.DirectBuffer messageName, long messageKey, org.agrona.DirectBuffer variables, org.agrona.DirectBuffer correlationKey, String tenantId)
      Sends the correlate process message subscription command directly to the subscribed partition. This differs to ${link correlateProcessMessageSubscription}, as the sending/writing is not delayed. Usually useful or used in scheduled tasks, which want to directly send commands.
      Parameters:
      processInstanceKey - the related process instance key
      elementInstanceKey - the related element instance key
      bpmnProcessId - the related process id
      messageName - the name of the message for which the subscription should be correlated
      messageKey - the key of the message for which the subscription should be correlated
      variables - the variables of the message
      correlationKey - the correlation key for which the message should be correlated
      tenantId - the tenant the message subscription is correlated for
    • correlateMessageSubscription

      public boolean correlateMessageSubscription(int subscriptionPartitionId, long processInstanceKey, long elementInstanceKey, org.agrona.DirectBuffer bpmnProcessId, org.agrona.DirectBuffer messageName, String tenantId)
    • closeMessageSubscription

      public boolean closeMessageSubscription(int subscriptionPartitionId, long processInstanceKey, long elementInstanceKey, org.agrona.DirectBuffer messageName, String tenantId)
    • sendDirectCloseMessageSubscription

      public void sendDirectCloseMessageSubscription(int subscriptionPartitionId, long processInstanceKey, long elementInstanceKey, org.agrona.DirectBuffer messageName, String tenantId)
      Sends the close message subscription command directly to the subscription partition. This differs to ${link closeMessageSubscription}, as the sending/writing is not delayed. Usually useful or used in scheduled tasks, which want to directly send commands.
      Parameters:
      subscriptionPartitionId - the partition Id which should receive the command
      processInstanceKey - the related process instance key
      elementInstanceKey - the related element instance key
      messageName - the name of the message for which the subscription should be closed
      tenantId - the tenant for which the subscription should be closed
    • closeProcessMessageSubscription

      public boolean closeProcessMessageSubscription(long processInstanceKey, long elementInstanceKey, org.agrona.DirectBuffer messageName, String tenantId)
    • rejectCorrelateMessageSubscription

      public boolean rejectCorrelateMessageSubscription(int subscriptionPartitionId, long processInstanceKey, long elementInstanceKey, org.agrona.DirectBuffer bpmnProcessId, long messageKey, org.agrona.DirectBuffer messageName, org.agrona.DirectBuffer correlationKey, String tenantId)
    • setWriters

      public void setWriters(Writers writers)