Class SubscriptionCommandSender
java.lang.Object
io.camunda.zeebe.engine.processing.message.command.SubscriptionCommandSender
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
ConstructorsConstructorDescriptionSubscriptionCommandSender
(int senderPartition, InterPartitionCommandSender interPartitionCommandSender) -
Method Summary
Modifier and TypeMethodDescriptionboolean
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
setWriters
(Writers writers)
-
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 commandprocessInstanceKey
- the related process instance keyelementInstanceKey
- the related element instance keybpmnProcessId
- the related process idmessageName
- the name of the message for which the subscription should be correlatedcorrelationKey
- the correlation key for which the message should be correlatedcloseOnCorrelate
- indicates whether the subscription should be closed after correlationtenantId
- 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 keyelementInstanceKey
- the related element instance keybpmnProcessId
- the related process idmessageName
- the name of the message for which the subscription should be correlatedmessageKey
- the key of the message for which the subscription should be correlatedvariables
- the variables of the messagecorrelationKey
- the correlation key for which the message should be correlatedtenantId
- 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 commandprocessInstanceKey
- the related process instance keyelementInstanceKey
- the related element instance keymessageName
- the name of the message for which the subscription should be closedtenantId
- 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
-