Class PublishMessageCommandImpl
- java.lang.Object
-
- io.camunda.zeebe.client.impl.command.CommandWithVariables<PublishMessageCommandImpl>
-
- io.camunda.zeebe.client.impl.command.PublishMessageCommandImpl
-
- All Implemented Interfaces:
FinalCommandStep<PublishMessageResponse>
,PublishMessageCommandStep1
,PublishMessageCommandStep1.PublishMessageCommandStep2
,PublishMessageCommandStep1.PublishMessageCommandStep3
public final class PublishMessageCommandImpl extends CommandWithVariables<PublishMessageCommandImpl> implements 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
-
-
Constructor Summary
Constructors Constructor Description PublishMessageCommandImpl(GatewayGrpc.GatewayStub asyncStub, ZeebeClientConfiguration configuration, JsonMapper jsonMapper, Predicate<Throwable> retryPredicate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PublishMessageCommandStep1.PublishMessageCommandStep3
correlationKey(String correlationKey)
Set the value of the correlation key of the message.PublishMessageCommandStep1.PublishMessageCommandStep3
messageId(String messageId)
Set the id of the message.PublishMessageCommandStep1.PublishMessageCommandStep2
messageName(String messageName)
Set the name of the message.FinalCommandStep<PublishMessageResponse>
requestTimeout(Duration requestTimeout)
Sets the request timeout for the command.ZeebeFuture<PublishMessageResponse>
send()
Sends the command to the Zeebe broker.protected PublishMessageCommandImpl
setVariablesInternal(String variables)
PublishMessageCommandStep1.PublishMessageCommandStep3
timeToLive(Duration timeToLive)
Set the time-to-live of the message.-
Methods inherited from class io.camunda.zeebe.client.impl.command.CommandWithVariables
variables, variables, variables, variables
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.camunda.zeebe.client.api.command.PublishMessageCommandStep1.PublishMessageCommandStep3
variables, variables, variables, variables
-
-
-
-
Constructor Detail
-
PublishMessageCommandImpl
public PublishMessageCommandImpl(GatewayGrpc.GatewayStub asyncStub, ZeebeClientConfiguration configuration, JsonMapper jsonMapper, Predicate<Throwable> retryPredicate)
-
-
Method Detail
-
setVariablesInternal
protected PublishMessageCommandImpl setVariablesInternal(String variables)
- Specified by:
setVariablesInternal
in classCommandWithVariables<PublishMessageCommandImpl>
-
messageId
public PublishMessageCommandStep1.PublishMessageCommandStep3 messageId(String 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
public PublishMessageCommandStep1.PublishMessageCommandStep3 timeToLive(Duration 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
public PublishMessageCommandStep1.PublishMessageCommandStep3 correlationKey(String 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
public PublishMessageCommandStep1.PublishMessageCommandStep2 messageName(String 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
-
requestTimeout
public FinalCommandStep<PublishMessageResponse> requestTimeout(Duration 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
public ZeebeFuture<PublishMessageResponse> 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.
-
-