Package org.springframework.pulsar.core
Class PulsarTemplate.SendMessageBuilderImpl<T>
java.lang.Object
org.springframework.pulsar.core.PulsarTemplate.SendMessageBuilderImpl<T>
- All Implemented Interfaces:
PulsarOperations.SendMessageBuilder<T>
- Enclosing class:
- PulsarTemplate<T>
public static class PulsarTemplate.SendMessageBuilderImpl<T>
extends Object
implements PulsarOperations.SendMessageBuilder<T>
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.pulsar.client.api.MessageIdsend()Send the message in a blocking manner using the configured specification.CompletableFuture<org.apache.pulsar.client.api.MessageId>Uses the configured specification to send the message in a non-blocking manner.withEncryptionKeys(Collection<String> encryptionKeys) Specify the encryption keys to use.withMessageCustomizer(TypedMessageBuilderCustomizer<T> messageCustomizer) Specifies the message customizer to use to further configure the message.withProducerCustomizer(ProducerBuilderCustomizer<T> producerCustomizer) Specifies the customizer to use to further configure the producer builder.withSchema(org.apache.pulsar.client.api.Schema<T> schema) Specify the schema to use when sending the message.Specify the topic to send the message to.
-
Method Details
-
withTopic
Description copied from interface:PulsarOperations.SendMessageBuilderSpecify the topic to send the message to.- Specified by:
withTopicin interfacePulsarOperations.SendMessageBuilder<T>- Parameters:
topic- the destination topic- Returns:
- the current builder with the destination topic specified
-
withSchema
public PulsarOperations.SendMessageBuilder<T> withSchema(org.apache.pulsar.client.api.Schema<T> schema) Description copied from interface:PulsarOperations.SendMessageBuilderSpecify the schema to use when sending the message.- Specified by:
withSchemain interfacePulsarOperations.SendMessageBuilder<T>- Parameters:
schema- the schema to use- Returns:
- the current builder with the schema specified
-
withEncryptionKeys
Description copied from interface:PulsarOperations.SendMessageBuilderSpecify the encryption keys to use.- Specified by:
withEncryptionKeysin interfacePulsarOperations.SendMessageBuilder<T>- Parameters:
encryptionKeys- the encryption keys- Returns:
- the current builder with the encryption keys specified
-
withMessageCustomizer
public PulsarOperations.SendMessageBuilder<T> withMessageCustomizer(TypedMessageBuilderCustomizer<T> messageCustomizer) Description copied from interface:PulsarOperations.SendMessageBuilderSpecifies the message customizer to use to further configure the message.- Specified by:
withMessageCustomizerin interfacePulsarOperations.SendMessageBuilder<T>- Parameters:
messageCustomizer- the message customizer- Returns:
- the current builder with the message customizer specified
-
withProducerCustomizer
public PulsarOperations.SendMessageBuilder<T> withProducerCustomizer(ProducerBuilderCustomizer<T> producerCustomizer) Description copied from interface:PulsarOperations.SendMessageBuilderSpecifies the customizer to use to further configure the producer builder.- Specified by:
withProducerCustomizerin interfacePulsarOperations.SendMessageBuilder<T>- Parameters:
producerCustomizer- the producer builder customizer- Returns:
- the current builder with the producer builder customizer specified
-
send
public org.apache.pulsar.client.api.MessageId send() throws org.apache.pulsar.client.api.PulsarClientExceptionDescription copied from interface:PulsarOperations.SendMessageBuilderSend the message in a blocking manner using the configured specification.- Specified by:
sendin interfacePulsarOperations.SendMessageBuilder<T>- Returns:
- the id assigned by the broker to the published message
- Throws:
org.apache.pulsar.client.api.PulsarClientException- if an error occurs
-
sendAsync
public CompletableFuture<org.apache.pulsar.client.api.MessageId> sendAsync() throws org.apache.pulsar.client.api.PulsarClientExceptionDescription copied from interface:PulsarOperations.SendMessageBuilderUses the configured specification to send the message in a non-blocking manner.- Specified by:
sendAsyncin interfacePulsarOperations.SendMessageBuilder<T>- Returns:
- a future that holds the id assigned by the broker to the published message
- Throws:
org.apache.pulsar.client.api.PulsarClientException- if an error occurs
-