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.MessageId
send()
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.SendMessageBuilder
Specify the topic to send the message to.- Specified by:
withTopic
in 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.SendMessageBuilder
Specify the schema to use when sending the message.- Specified by:
withSchema
in interfacePulsarOperations.SendMessageBuilder<T>
- Parameters:
schema
- the schema to use- Returns:
- the current builder with the schema specified
-
withEncryptionKeys
Description copied from interface:PulsarOperations.SendMessageBuilder
Specify the encryption keys to use.- Specified by:
withEncryptionKeys
in 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.SendMessageBuilder
Specifies the message customizer to use to further configure the message.- Specified by:
withMessageCustomizer
in 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.SendMessageBuilder
Specifies the customizer to use to further configure the producer builder.- Specified by:
withProducerCustomizer
in 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()Description copied from interface:PulsarOperations.SendMessageBuilder
Send the message in a blocking manner using the configured specification.- Specified by:
send
in interfacePulsarOperations.SendMessageBuilder<T>
- Returns:
- the id assigned by the broker to the published message
-
sendAsync
Description copied from interface:PulsarOperations.SendMessageBuilder
Uses the configured specification to send the message in a non-blocking manner.- Specified by:
sendAsync
in interfacePulsarOperations.SendMessageBuilder<T>
- Returns:
- a future that holds the id assigned by the broker to the published message
-