Class PublishMessageCommandImpl
- All Implemented Interfaces:
CommandWithTenantStep<PublishMessageCommandStep1.PublishMessageCommandStep3>
,FinalCommandStep<PublishMessageResponse>
,PublishMessageCommandStep1
,PublishMessageCommandStep1.PublishMessageCommandStep2
,PublishMessageCommandStep1.PublishMessageCommandStep3
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.zeebe.client.api.command.PublishMessageCommandStep1
PublishMessageCommandStep1.PublishMessageCommandStep2, PublishMessageCommandStep1.PublishMessageCommandStep3
-
Field Summary
Fields inherited from class io.camunda.zeebe.client.impl.command.CommandWithVariables
objectMapper
Fields inherited from interface io.camunda.zeebe.client.api.command.CommandWithTenantStep
DEFAULT_TENANT_IDENTIFIER
-
Constructor Summary
ConstructorsConstructorDescriptionPublishMessageCommandImpl
(GatewayGrpc.GatewayStub asyncStub, ZeebeClientConfiguration configuration, JsonMapper jsonMapper, Predicate<Throwable> retryPredicate) -
Method Summary
Modifier and TypeMethodDescriptioncorrelationKey
(String correlationKey) Set the value of the correlation key of the message.Set the id of the message.messageName
(String messageName) Set the name of the message.requestTimeout
(Duration requestTimeout) Sets the request timeout for the command.send()
Sends the command to the Zeebe broker.protected PublishMessageCommandImpl
setVariablesInternal
(String variables) Specifies the tenant that will own any entities (e.g.timeToLive
(Duration timeToLive) Set the time-to-live of the message.Methods inherited from class io.camunda.zeebe.client.impl.command.CommandWithVariables
variable, variables, variables, variables, variables
-
Constructor Details
-
PublishMessageCommandImpl
public PublishMessageCommandImpl(GatewayGrpc.GatewayStub asyncStub, ZeebeClientConfiguration configuration, JsonMapper jsonMapper, Predicate<Throwable> retryPredicate)
-
-
Method Details
-
setVariablesInternal
- Specified by:
setVariablesInternal
in classCommandWithVariables<PublishMessageCommandImpl>
-
messageId
Description copied from interface:PublishMessageCommandStep1.PublishMessageCommandStep3
Set the id of the message. The message is rejected if another message is already published with the same id, name and correlation-key.- Specified by:
messageId
in interfacePublishMessageCommandStep1.PublishMessageCommandStep3
- Parameters:
messageId
- the id of the message- Returns:
- the builder for this command. Call
FinalCommandStep.send()
to complete the command and send it to the broker.
-
timeToLive
Description copied from interface:PublishMessageCommandStep1.PublishMessageCommandStep3
Set the time-to-live of the message. The message can only be correlated within the given time-to-live.If the duration is zero or negative then the message can only be correlated to open subscriptions (e.g. to an entered message catch event).
If no duration is set then the default is used from the configuration.
- Specified by:
timeToLive
in interfacePublishMessageCommandStep1.PublishMessageCommandStep3
- Parameters:
timeToLive
- the time-to-live of the message- Returns:
- the builder for this command. Call
FinalCommandStep.send()
to complete the command and send it to the broker.
-
correlationKey
Description copied from interface:PublishMessageCommandStep1.PublishMessageCommandStep2
Set the value of the correlation key of the message.This value will be used together with the message name to find matching message subscriptions.
- Specified by:
correlationKey
in interfacePublishMessageCommandStep1.PublishMessageCommandStep2
- Parameters:
correlationKey
- the correlation key value of the message- Returns:
- the builder for this command
-
messageName
Description copied from interface:PublishMessageCommandStep1
Set the name of the message.- Specified by:
messageName
in interfacePublishMessageCommandStep1
- Parameters:
messageName
- the name of the message- Returns:
- the builder for this command
-
tenantId
Description copied from interface:CommandWithTenantStep
Specifies the tenant that will own any entities (e.g. process definition, process instances, etc.) resulting from this command, or that owns any entities (e.g. jobs) referred to from this command.Multi-tenancy
Multiple tenants can share a Zeebe cluster. Entities can be assigned to a specific tenant using an identifier. Only that tenant can access these entities.
Any entities created before multi-tenancy has been enabled in the Zeebe cluster, are assigned to the
CommandWithTenantStep.DEFAULT_TENANT_IDENTIFIER
.If no tenant is explicitly specified, then the command is rejected.
- Specified by:
tenantId
in interfaceCommandWithTenantStep<PublishMessageCommandStep1.PublishMessageCommandStep3>
- Parameters:
tenantId
- the identifier of the tenant to specify for this command, e.g."ACME"
- Returns:
- the builder for this command with the tenant specified
-
requestTimeout
Description copied from interface:FinalCommandStep
Sets the request timeout for the command. The default request timeout can be configured usingZeebeClientBuilder.defaultRequestTimeout(Duration)
.- Specified by:
requestTimeout
in interfaceFinalCommandStep<PublishMessageResponse>
- Parameters:
requestTimeout
- the request timeout- Returns:
- the configured command
-
send
Description copied from interface:FinalCommandStep
Sends the command to the Zeebe broker. This operation is asynchronous. In case of success, the future returns the event that was generated by the Zeebe broker in response to the command.Call
ZeebeFuture.join()
to wait until the response is available.Future<JobEvent> future = command.send(); JobEvent event = future.join();
- Specified by:
send
in interfaceFinalCommandStep<PublishMessageResponse>
- Returns:
- a future tracking state of success/failure of the command.
-